* is "volatile" the cause of ifconfig flags not matching sysfs flags?
@ 2018-08-22 22:32 Robert P. J. Day
2018-08-22 22:53 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Robert P. J. Day @ 2018-08-22 22:32 UTC (permalink / raw)
To: Linux kernel netdev mailing list
almost certainly another dumb question, but i was poking around the
sysfs, particularly /sys/class/net/<ifname>/*, to familiarize myself
with what i can glean (or set) re interfaces under /sys, and i noticed
"flags", but what i get there doesn't match what i get by running
ifconfig.
specifically, if i list the flags for my wireless interface under
/sys:
$ cat flags
0x1003
$
but with ifconfig:
$ ifconfig wlp2s0
wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
^^^^
do those two "flags" values represent the same set of flags? and
does the obvious difference have to do with some of those flags being
"volatile" as dewscribed in include/uapi/linux/if.h? or am i just
totally misreading this?
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca/dokuwiki
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: is "volatile" the cause of ifconfig flags not matching sysfs flags?
2018-08-22 22:32 is "volatile" the cause of ifconfig flags not matching sysfs flags? Robert P. J. Day
@ 2018-08-22 22:53 ` Stephen Hemminger
2018-08-23 11:50 ` Robert P. J. Day
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2018-08-22 22:53 UTC (permalink / raw)
To: Robert P. J. Day; +Cc: Linux kernel netdev mailing list
On Wed, 22 Aug 2018 18:32:36 -0400 (EDT)
"Robert P. J. Day" <rpjday@crashcourse.ca> wrote:
> almost certainly another dumb question, but i was poking around the
> sysfs, particularly /sys/class/net/<ifname>/*, to familiarize myself
> with what i can glean (or set) re interfaces under /sys, and i noticed
> "flags", but what i get there doesn't match what i get by running
> ifconfig.
>
> specifically, if i list the flags for my wireless interface under
> /sys:
>
> $ cat flags
> 0x1003
> $
>
> but with ifconfig:
>
> $ ifconfig wlp2s0
> wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
> ^^^^
>
> do those two "flags" values represent the same set of flags? and
> does the obvious difference have to do with some of those flags being
> "volatile" as dewscribed in include/uapi/linux/if.h? or am i just
> totally misreading this?
>
> rday
>
sysfs reports netdevice->if_flags where as ifconfig is getting hex
value from SIOCGIFFLAGS which does:
dev_get_flags(dev)
The value in sysfs is more intended for internal debugging, where all the
normal userspace API's return a more limited set of historical values.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: is "volatile" the cause of ifconfig flags not matching sysfs flags?
2018-08-22 22:53 ` Stephen Hemminger
@ 2018-08-23 11:50 ` Robert P. J. Day
0 siblings, 0 replies; 3+ messages in thread
From: Robert P. J. Day @ 2018-08-23 11:50 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Linux kernel netdev mailing list
On Wed, 22 Aug 2018, Stephen Hemminger wrote:
> On Wed, 22 Aug 2018 18:32:36 -0400 (EDT)
> "Robert P. J. Day" <rpjday@crashcourse.ca> wrote:
>
> > almost certainly another dumb question, but i was poking around the
> > sysfs, particularly /sys/class/net/<ifname>/*, to familiarize myself
> > with what i can glean (or set) re interfaces under /sys, and i noticed
> > "flags", but what i get there doesn't match what i get by running
> > ifconfig.
> >
> > specifically, if i list the flags for my wireless interface under
> > /sys:
> >
> > $ cat flags
> > 0x1003
> > $
> >
> > but with ifconfig:
> >
> > $ ifconfig wlp2s0
> > wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
> > ^^^^
> >
> > do those two "flags" values represent the same set of flags? and
> > does the obvious difference have to do with some of those flags being
> > "volatile" as dewscribed in include/uapi/linux/if.h? or am i just
> > totally misreading this?
> >
> > rday
> >
>
> sysfs reports netdevice->if_flags where as ifconfig is getting hex
> value from SIOCGIFFLAGS which does:
> dev_get_flags(dev)
>
> The value in sysfs is more intended for internal debugging, where
> all the normal userspace API's return a more limited set of
> historical values.
so the history aside, those values ultimately represent the same
flags?
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca/dokuwiki
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-23 15:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-22 22:32 is "volatile" the cause of ifconfig flags not matching sysfs flags? Robert P. J. Day
2018-08-22 22:53 ` Stephen Hemminger
2018-08-23 11:50 ` Robert P. J. Day
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).