From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: is "volatile" the cause of ifconfig flags not matching sysfs flags? Date: Wed, 22 Aug 2018 15:53:22 -0700 Message-ID: <20180822155322.335bd34c@xeon-e3> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Linux kernel netdev mailing list To: "Robert P. J. Day" Return-path: Received: from mail-pf1-f178.google.com ([209.85.210.178]:36400 "EHLO mail-pf1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbeHWCUR (ORCPT ); Wed, 22 Aug 2018 22:20:17 -0400 Received: by mail-pf1-f178.google.com with SMTP id b11-v6so1675867pfo.3 for ; Wed, 22 Aug 2018 15:53:29 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 22 Aug 2018 18:32:36 -0400 (EDT) "Robert P. J. Day" wrote: > almost certainly another dumb question, but i was poking around the > sysfs, particularly /sys/class/net//*, 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 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.