aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/if_inet6.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2010-05-18 18:36:06 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-18 18:36:06 -0400
commite9d3e084975869754d16f639378675c353560be9 (patch)
tree3f933fea12746b24247ccec79cb4a1fbdf50833b /include/net/if_inet6.h
parente29f5dbc9e9719af158a960e5c1d16f32740ebc3 (diff)
ipv6: Replace inet6_ifaddr->dead with state
This patch replaces the boolean dead flag on inet6_ifaddr with a state enum. This allows us to roll back changes when deleting an address according to whether DAD has completed or not. This patch only adds the state field and does not change the logic. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/if_inet6.h')
-rw-r--r--include/net/if_inet6.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 13f9fc086d54..f95ff8d9aa47 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -32,6 +32,13 @@
32 32
33#ifdef __KERNEL__ 33#ifdef __KERNEL__
34 34
35enum {
36 INET6_IFADDR_STATE_DAD,
37 INET6_IFADDR_STATE_POSTDAD,
38 INET6_IFADDR_STATE_UP,
39 INET6_IFADDR_STATE_DEAD,
40};
41
35struct inet6_ifaddr { 42struct inet6_ifaddr {
36 struct in6_addr addr; 43 struct in6_addr addr;
37 __u32 prefix_len; 44 __u32 prefix_len;
@@ -40,6 +47,9 @@ struct inet6_ifaddr {
40 __u32 prefered_lft; 47 __u32 prefered_lft;
41 atomic_t refcnt; 48 atomic_t refcnt;
42 spinlock_t lock; 49 spinlock_t lock;
50 spinlock_t state_lock;
51
52 int state;
43 53
44 __u8 probes; 54 __u8 probes;
45 __u8 flags; 55 __u8 flags;
@@ -62,8 +72,6 @@ struct inet6_ifaddr {
62 struct inet6_ifaddr *ifpub; 72 struct inet6_ifaddr *ifpub;
63 int regen_count; 73 int regen_count;
64#endif 74#endif
65
66 int dead;
67 struct rcu_head rcu; 75 struct rcu_head rcu;
68}; 76};
69 77