diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-04-23 09:32:30 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-04-23 09:32:30 +0000 |
commit | c797841f0da1dbdd3f6280d977851c0b16d96d9c (patch) | |
tree | 7934d88798732f0f162eb9c5b1ea77a0f2be4c4b /sys/net/if.h | |
parent | a0b32f475368730067f063113ffbc4315e12ad91 (diff) | |
download | FreeBSD-src-c797841f0da1dbdd3f6280d977851c0b16d96d9c.zip FreeBSD-src-c797841f0da1dbdd3f6280d977851c0b16d96d9c.tar.gz |
Add a new interface flag, IFF_DYING, which is set when a device driver
calls if_free(), and remains set if the refcount is elevated. IF_DYING
skips the bit in the if_flags bitmask previously used by IFF_NEEDSGIANT,
so that an MFC can be done without changing which bit is used, as
IFF_NEEDSGIANT is still present in 7.x.
ifnet_byindex_ref() checks for IFF_DYING and returns NULL if it is set,
preventing new references from by acquired by index, preventing
monitoring sysctls from seeing it. Other lookup mechanisms currently
do not check IFF_DYING, but may need to in the future.
MFC after: 3 weeks
Diffstat (limited to 'sys/net/if.h')
-rw-r--r-- | sys/net/if.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if.h b/sys/net/if.h index 14d61ac..30b9ccb 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -149,6 +149,7 @@ struct if_data { #define IFF_PPROMISC 0x20000 /* (n) user-requested promisc mode */ #define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */ #define IFF_STATICARP 0x80000 /* (n) static ARP */ +#define IFF_DYING 0x200000 /* (n) interface is winding down */ /* * Old names for driver flags so that user space tools can continue to use @@ -162,7 +163,8 @@ struct if_data { /* flags set internally only: */ #define IFF_CANTCHANGE \ (IFF_BROADCAST|IFF_POINTOPOINT|IFF_DRV_RUNNING|IFF_DRV_OACTIVE|\ - IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC) + IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\ + IFF_DYING) /* * Values for if_link_state. |