public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
To: Erik Flodin <erik@flodin.me>, mtk.manpages@gmail.com
Cc: linux-man@vger.kernel.org, Stefan Rompf <stefan@loplof.de>,
	"David S. Miller" <davem@davemloft.net>,
	Fredrik Arnerup <fredrik.arnerup@edgeware.tv>,
	John Dykstra <john.dykstra1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Oliver Hartkopp <oliver.hartkopp@volkswagen.de>,
	Urs Thuermann <urs.thuermann@volkswagen.de>
Subject: Re: netdevice.7 SIOCGIFFLAGS/SIOCSIFFLAGS
Date: Fri, 19 Mar 2021 20:53:12 +0100	[thread overview]
Message-ID: <b0a534b3-9bdf-868e-1f28-8e32d31013a2@gmail.com> (raw)
In-Reply-To: <CAAMKmof+Y+qrro7Ohd9FSw1bf+-tLMPzaTba-tVniAMY0zwTOQ@mail.gmail.com>

[CC += Fredrik, John, David S., Steven, Oliver, Urs]

Hi,

On 3/17/21 3:12 PM, Erik Flodin wrote:
> Hi,
> 
> The documentation for SIOCGIFFLAGS/SIOCSIFFLAGS in netdevice.7 lists
> IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO, but those can't be set in
> ifr_flags as it is only a short and the flags start at 1<<16.
> 
> See also https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=746e6ad23cd6fec2edce056e014a0eabeffa838c
> 

I don't know what's the history of that.
I researched a bit, and while the struct member is indeed a 'short' [1],
the flags were added to the kernel for some reason.
I added a few people to the thread that may know better what to do.Let's
see if they can comment.

Links to relevant commits:

<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=746e6ad23cd6fec2edce056e014a0eabeffa838c>
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b00055aacdb172c05067612278ba27265fcd05ce>
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cd05acfe65ed2cf2db683fa9a6adb8d35635263b>
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=6ecda4d14604d250d385346f4fe9de707f281759>

Thanks,

Alex

[1]:

.../linux$ sed -n '/struct ifreq {/,/};/p' include/uapi/linux/if.h
struct ifreq {
#define IFHWADDRLEN	6
	union
	{
		char	ifrn_name[IFNAMSIZ];		/* if name, e.g. "en0" */
	} ifr_ifrn;
	
	union {
		struct	sockaddr ifru_addr;
		struct	sockaddr ifru_dstaddr;
		struct	sockaddr ifru_broadaddr;
		struct	sockaddr ifru_netmask;
		struct  sockaddr ifru_hwaddr;
		short	ifru_flags;
		int	ifru_ivalue;
		int	ifru_mtu;
		struct  ifmap ifru_map;
		char	ifru_slave[IFNAMSIZ];	/* Just fits the size */
		char	ifru_newname[IFNAMSIZ];
		void __user *	ifru_data;
		struct	if_settings ifru_settings;
	} ifr_ifru;
};
.../linux$ grep 'define\sifr_flags' include/uapi/linux/if.h
#define	ifr_flags	ifr_ifru.ifru_flags	/* flags		*/
.../linux$
	
-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

  reply	other threads:[~2021-03-19 19:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 14:12 netdevice.7 SIOCGIFFLAGS/SIOCSIFFLAGS Erik Flodin
2021-03-19 19:53 ` Alejandro Colomar (man-pages) [this message]
2021-04-14 18:52   ` Erik Flodin
2021-04-14 19:56     ` Alejandro Colomar (man-pages)
2021-04-29 19:45       ` Erik Flodin
2021-04-30 19:32         ` Alejandro Colomar (man-pages)
     [not found]           ` <CAAMKmocBEr05EfidF9CfqJQw4uj1YcYwmkJPR=c0eCCYgsAHwg@mail.gmail.com>
2021-11-12 21:01             ` Alejandro Colomar (man-pages)

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=b0a534b3-9bdf-868e-1f28-8e32d31013a2@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=davem@davemloft.net \
    --cc=erik@flodin.me \
    --cc=fredrik.arnerup@edgeware.tv \
    --cc=john.dykstra1@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=oliver.hartkopp@volkswagen.de \
    --cc=stefan@loplof.de \
    --cc=urs.thuermann@volkswagen.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox