[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iL6wo_OYw0E4uSsydJNVsfWvj5LytrWrQbbhmrN3k5kbA@mail.gmail.com>
Date: Wed, 11 Sep 2024 09:21:24 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Atlas Yu <atlas.yu@...onical.com>, kuba@...nel.org, davem@...emloft.net,
pabeni@...hat.com, netdev@...r.kernel.org
Subject: Re: [PATCH net v1] dev_ioctl: fix the type of ifr_flags
On Wed, Sep 11, 2024 at 7:00 AM Stephen Hemminger
<stephen@...workplumber.org> wrote:
>
> On Wed, 11 Sep 2024 12:17:24 +0800
> Atlas Yu <atlas.yu@...onical.com> wrote:
>
> > On Wed, Sep 11, 2024 at 11:56 AM
> > Stephen Hemminger <stephen@...workplumber.org> wrote:
> >
> > > On Wed, 11 Sep 2024 11:46:08 +0800
> > > Atlas Yu <atlas.yu@...onical.com> wrote:
> > > > diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h
> > > > index 797ba2c1562a..b612b6cd7446 100644
> > > > --- a/include/uapi/linux/if.h
> > > > +++ b/include/uapi/linux/if.h
> > > > @@ -244,7 +244,7 @@ struct ifreq {
> > > > struct sockaddr ifru_broadaddr;
> > > > struct sockaddr ifru_netmask;
> > > > struct sockaddr ifru_hwaddr;
> > > > - short ifru_flags;
> > > > + unsigned int ifru_flags;
> > > > int ifru_ivalue;
> > > > int ifru_mtu;
> > > > struct ifmap ifru_map;
> > >
> > > NAK
> > > This breaks userspace ABI. There is no guarantee that
> > > older application correctly zeros the upper flag bits.
> >
> > Thanks, any suggestions though? How about introducing
> > another ioctl request for these extended bits.
>
> Doing anything with ioctl's is hard, there are so many layers to deal with.
> Mostly, networking has treated ioctl's as legacy API and switched to using
> netlink for any new features.
Note that rtnetlink gets the 32bit flags already, this has been the
case for 20 years or more.
include/uapi/linux/rtnetlink.h:566: unsigned ifi_flags;
/* IFF_* flags */
net/core/rtnetlink.c : rtnl_fill_ifinfo(...)
ifm->ifi_flags = dev_get_flags(dev);
iproute2 also displays more than 16 bits in print_link_flags()
Powered by blists - more mailing lists