diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-15 08:16:34 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-20 17:03:00 +0200 |
commit | 4edf547b4d0f886acf5aa5a0c8f8edbaff280830 (patch) | |
tree | 5dd08879421a2be32a3c89c9bd76506a5cb8e9e3 /include | |
parent | b44: strncpy does not null terminate string (diff) | |
download | linux-4edf547b4d0f886acf5aa5a0c8f8edbaff280830.tar.xz linux-4edf547b4d0f886acf5aa5a0c8f8edbaff280830.zip |
net: explain netns notifiers a little better
Eric explained this to me -- and afterwards the comment
made sense, but not before. Add the the critical point
about interfaces having to be gone from the netns before
subsys notifiers are called.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/net_namespace.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 5c5136fceea8..a1202841aadd 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -239,13 +239,15 @@ struct pernet_operations { * needs per network namespace operations use device pernet operations, * otherwise use pernet subsys operations. * - * This is critically important. Most of the network code cleanup - * runs with the assumption that dev_remove_pack has been called so no - * new packets will arrive during and after the cleanup functions have - * been called. dev_remove_pack is not per namespace so instead the - * guarantee of no more packets arriving in a network namespace is - * provided by ensuring that all network devices and all sockets have - * left the network namespace before the cleanup methods are called. + * Network interfaces need to be removed from a dying netns _before_ + * subsys notifiers can be called, as most of the network code cleanup + * (which is done from subsys notifiers) runs with the assumption that + * dev_remove_pack has been called so no new packets will arrive during + * and after the cleanup functions have been called. dev_remove_pack + * is not per namespace so instead the guarantee of no more packets + * arriving in a network namespace is provided by ensuring that all + * network devices and all sockets have left the network namespace + * before the cleanup methods are called. * * For the longest time the ipv4 icmp code was registered as a pernet * device which caused kernel oops, and panics during network |