Message ID | 1244219047.7969.7.camel@Maple |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: John Dykstra <john.dykstra1@gmail.com> Date: Fri, 05 Jun 2009 16:24:07 +0000 > On Fri, 2009-05-29 at 20:50 -0700, Andrew Morton wrote: >> On Thu, 28 May 2009 14:59:05 +0200 "Fredrik Arnerup" <fredrik.arnerup@edgeware.tv> wrote: >> >> > Documentation/networking/operstates.txt (and netdevice(7)) claims that >> > the flags IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO can be read from user space >> > using ioctl() with SIOCGIFFLAGS. Looking in include/linux/if.h however, >> > the flags are returned in a struct ifreq in the field ifr_flags which >> > is declared as a short, while the flags are defined as: >> > >> > #define IFF_LOWER_UP 0x10000 /* driver signals L1 up */ >> > #define IFF_DORMANT 0x20000 /* driver signals dormant */ >> > #define IFF_ECHO 0x40000 /* echo sent packets */ > > [PATCH] net core: Some interface flags not returned by SIOCGIFFLAGS ... > Reported-by: "Fredrik Arnerup" <fredrik.arnerup@edgeware.tv> > Signed-off-by: John Dykstra <john.dykstra1@gmail.com> Applied, thanks! -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt index c9074f9..1a77a3c 100644 --- a/Documentation/networking/operstates.txt +++ b/Documentation/networking/operstates.txt @@ -38,9 +38,6 @@ ifinfomsg::if_flags & IFF_LOWER_UP: ifinfomsg::if_flags & IFF_DORMANT: Driver has signaled netif_dormant_on() -These interface flags can also be queried without netlink using the -SIOCGIFFLAGS ioctl. - TLV IFLA_OPERSTATE contains RFC2863 state of the interface in numeric representation: diff --git a/net/core/dev.c b/net/core/dev.c index e2e9e4a..5c7602b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3853,7 +3853,7 @@ static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cm switch (cmd) { case SIOCGIFFLAGS: /* Get interface flags */ - ifr->ifr_flags = dev_get_flags(dev); + ifr->ifr_flags = (short) dev_get_flags(dev); return 0; case SIOCGIFMETRIC: /* Get the metric on the interface