diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-09 12:15:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-09 12:15:40 -0400 |
commit | df0b4a5080ca668636831b641a6356500fb5c637 (patch) | |
tree | aaab82b392b4e1fdc672ab55efb017c91fdc6616 /include | |
parent | 39a3478c1c0122640b1a0ead0d7cccd0804b1750 (diff) | |
parent | c0350024723b4a69e38655816484d934aca8eb30 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (29 commits)
p54: fix race condition in memory management
cfg80211: test before subtraction on unsigned
iwlwifi: fix error flow in iwl*_pci_probe
rt2x00 : more devices to rt73usb.c
rt2x00 : more devices to rt2500usb.c
bonding: Fix device passed into ->ndo_neigh_setup().
vlan: Fix vlan-in-vlan crashes.
net: Fix missing dev->neigh_setup in register_netdevice().
tmspci: fix request_irq race
pkt_sched: act_police: Fix a rate estimator test.
tg3: Fix 5906 link problems
SCTP: change sctp_ctl_sock_init() to try IPv4 if IPv6 fails
IPv6: add "disable" module parameter support to ipv6.ko
sungem: another error printed one too early
aoe: error printed 1 too early
net pcmcia: worklimit reaches -1
net: more timeouts that reach -1
net: fix tokenring license
dm9601: new vendor/product IDs
netlink: invert error code in netlink_set_err()
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 1 | ||||
-rw-r--r-- | include/net/net_namespace.h | 27 |
2 files changed, 18 insertions, 10 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ec54785d34f9..659366734f3f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1079,6 +1079,7 @@ extern void synchronize_net(void); | |||
1079 | extern int register_netdevice_notifier(struct notifier_block *nb); | 1079 | extern int register_netdevice_notifier(struct notifier_block *nb); |
1080 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | 1080 | extern int unregister_netdevice_notifier(struct notifier_block *nb); |
1081 | extern int init_dummy_netdev(struct net_device *dev); | 1081 | extern int init_dummy_netdev(struct net_device *dev); |
1082 | extern void netdev_resync_ops(struct net_device *dev); | ||
1082 | 1083 | ||
1083 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | 1084 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); |
1084 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); | 1085 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 6fc13d905c5f..ded434b032a4 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -109,11 +109,6 @@ extern struct list_head net_namespace_list; | |||
109 | #ifdef CONFIG_NET_NS | 109 | #ifdef CONFIG_NET_NS |
110 | extern void __put_net(struct net *net); | 110 | extern void __put_net(struct net *net); |
111 | 111 | ||
112 | static inline int net_alive(struct net *net) | ||
113 | { | ||
114 | return net && atomic_read(&net->count); | ||
115 | } | ||
116 | |||
117 | static inline struct net *get_net(struct net *net) | 112 | static inline struct net *get_net(struct net *net) |
118 | { | 113 | { |
119 | atomic_inc(&net->count); | 114 | atomic_inc(&net->count); |
@@ -145,11 +140,6 @@ int net_eq(const struct net *net1, const struct net *net2) | |||
145 | } | 140 | } |
146 | #else | 141 | #else |
147 | 142 | ||
148 | static inline int net_alive(struct net *net) | ||
149 | { | ||
150 | return 1; | ||
151 | } | ||
152 | |||
153 | static inline struct net *get_net(struct net *net) | 143 | static inline struct net *get_net(struct net *net) |
154 | { | 144 | { |
155 | return net; | 145 | return net; |
@@ -234,6 +224,23 @@ struct pernet_operations { | |||
234 | void (*exit)(struct net *net); | 224 | void (*exit)(struct net *net); |
235 | }; | 225 | }; |
236 | 226 | ||
227 | /* | ||
228 | * Use these carefully. If you implement a network device and it | ||
229 | * needs per network namespace operations use device pernet operations, | ||
230 | * otherwise use pernet subsys operations. | ||
231 | * | ||
232 | * This is critically important. Most of the network code cleanup | ||
233 | * runs with the assumption that dev_remove_pack has been called so no | ||
234 | * new packets will arrive during and after the cleanup functions have | ||
235 | * been called. dev_remove_pack is not per namespace so instead the | ||
236 | * guarantee of no more packets arriving in a network namespace is | ||
237 | * provided by ensuring that all network devices and all sockets have | ||
238 | * left the network namespace before the cleanup methods are called. | ||
239 | * | ||
240 | * For the longest time the ipv4 icmp code was registered as a pernet | ||
241 | * device which caused kernel oops, and panics during network | ||
242 | * namespace cleanup. So please don't get this wrong. | ||
243 | */ | ||
237 | extern int register_pernet_subsys(struct pernet_operations *); | 244 | extern int register_pernet_subsys(struct pernet_operations *); |
238 | extern void unregister_pernet_subsys(struct pernet_operations *); | 245 | extern void unregister_pernet_subsys(struct pernet_operations *); |
239 | extern int register_pernet_gen_subsys(int *id, struct pernet_operations *); | 246 | extern int register_pernet_gen_subsys(int *id, struct pernet_operations *); |