diff options
author | Michal Kubeček <mkubecek@suse.cz> | 2013-09-09 15:45:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-11 17:04:09 -0400 |
commit | 2c861cc65ef4604011a0082e4dcdba2819aa191a (patch) | |
tree | d6fe5436cf4d492c727cfb370232c87254d72097 /include/net | |
parent | 444fa88ac35aa1bf9b7c23945444bc67f631033b (diff) |
ipv6: don't call fib6_run_gc() until routing is ready
When loading the ipv6 module, ndisc_init() is called before
ip6_route_init(). As the former registers a handler calling
fib6_run_gc(), this opens a window to run the garbage collector
before necessary data structures are initialized. If a network
device is initialized in this window, adding MAC address to it
triggers a NETDEV_CHANGEADDR event, leading to a crash in
fib6_clean_all().
Take the event handler registration out of ndisc_init() into a
separate function ndisc_late_init() and move it after
ip6_route_init().
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ndisc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 3c4211f0bed6..ea0cc26ab70e 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -190,7 +190,9 @@ static inline struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, cons | |||
190 | } | 190 | } |
191 | 191 | ||
192 | extern int ndisc_init(void); | 192 | extern int ndisc_init(void); |
193 | extern int ndisc_late_init(void); | ||
193 | 194 | ||
195 | extern void ndisc_late_cleanup(void); | ||
194 | extern void ndisc_cleanup(void); | 196 | extern void ndisc_cleanup(void); |
195 | 197 | ||
196 | extern int ndisc_rcv(struct sk_buff *skb); | 198 | extern int ndisc_rcv(struct sk_buff *skb); |