summaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorStefan Rompf2006-03-21 02:09:11 +0100
committerDavid S. Miller2006-03-21 02:09:11 +0100
commitb00055aacdb172c05067612278ba27265fcd05ce (patch)
tree4dbbee11b02d54cc0978113dfb07c53fdce17aa8 /net/core/dev.c
parent[IPV6]: ROUTE: Ensure to accept redirects from nexthop for the target. (diff)
downloadkernel-qcow2-linux-b00055aacdb172c05067612278ba27265fcd05ce.tar.gz
kernel-qcow2-linux-b00055aacdb172c05067612278ba27265fcd05ce.tar.xz
kernel-qcow2-linux-b00055aacdb172c05067612278ba27265fcd05ce.zip
[NET] core: add RFC2863 operstate
this patch adds a dormant flag to network devices, RFC2863 operstate derived from these flags and possibility for userspace interaction. It allows drivers to signal that a device is unusable for user traffic without disabling queueing (and therefore the possibility for protocol establishment traffic to flow) and a userspace supplicant (WPA, 802.1X) to mark a device unusable without changes to the driver. It is the result of our long discussion. However I must admit that it represents what Jamal and I agreed on with compromises towards Krzysztof, but Thomas and Krzysztof still disagree with some parts. Anyway I think it should be applied. Signed-off-by: Stefan Rompf <stefan@loplof.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ef56c035d44e..8763c99fcb84 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2174,12 +2174,20 @@ unsigned dev_get_flags(const struct net_device *dev)
flags = (dev->flags & ~(IFF_PROMISC |
IFF_ALLMULTI |
- IFF_RUNNING)) |
+ IFF_RUNNING |
+ IFF_LOWER_UP |
+ IFF_DORMANT)) |
(dev->gflags & (IFF_PROMISC |
IFF_ALLMULTI));
- if (netif_running(dev) && netif_carrier_ok(dev))
- flags |= IFF_RUNNING;
+ if (netif_running(dev)) {
+ if (netif_oper_up(dev))
+ flags |= IFF_RUNNING;
+ if (netif_carrier_ok(dev))
+ flags |= IFF_LOWER_UP;
+ if (netif_dormant(dev))
+ flags |= IFF_DORMANT;
+ }
return flags;
}