All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Linux kernel netdev mailing list <netdev@vger.kernel.org>
Subject: Re: is "volatile" the cause of ifconfig flags not matching sysfs flags?
Date: Wed, 22 Aug 2018 15:53:22 -0700	[thread overview]
Message-ID: <20180822155322.335bd34c@xeon-e3> (raw)
In-Reply-To: <alpine.LFD.2.21.1808221824460.5035@localhost.localdomain>

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.

  reply	other threads:[~2018-08-23  2:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2018-08-23 11:50   ` Robert P. J. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180822155322.335bd34c@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.