diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-13 11:30:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-13 11:36:48 -0400 |
commit | e65ac4d54546b7d7514a9e8be1484c758f2b7ba3 (patch) | |
tree | 7b4bffabbe75739310e200360789e25732540da0 /net | |
parent | 816a7854d56f19aeba3c83e1ed8c2c0ef275365a (diff) | |
parent | d62f8dbb5b7771910f7c4657345df8ac93acb832 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull in the 'net' tree to get CAIF bug fixes upon which
the following set of CAIF feature patches depend.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/caif/chnl_net.c | 9 | ||||
-rw-r--r-- | net/core/dev.c | 20 | ||||
-rw-r--r-- | net/key/af_key.c | 2 | ||||
-rw-r--r-- | net/l2tp/l2tp_ip.c | 5 | ||||
-rw-r--r-- | net/phonet/pn_dev.c | 21 |
5 files changed, 32 insertions, 25 deletions
diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c index 93e9c6dc9ddf..69771c04ba8f 100644 --- a/net/caif/chnl_net.c +++ b/net/caif/chnl_net.c | |||
@@ -103,6 +103,7 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt) | |||
103 | skb->protocol = htons(ETH_P_IPV6); | 103 | skb->protocol = htons(ETH_P_IPV6); |
104 | break; | 104 | break; |
105 | default: | 105 | default: |
106 | kfree_skb(skb); | ||
106 | priv->netdev->stats.rx_errors++; | 107 | priv->netdev->stats.rx_errors++; |
107 | return -EINVAL; | 108 | return -EINVAL; |
108 | } | 109 | } |
@@ -220,14 +221,16 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
220 | 221 | ||
221 | if (skb->len > priv->netdev->mtu) { | 222 | if (skb->len > priv->netdev->mtu) { |
222 | pr_warn("Size of skb exceeded MTU\n"); | 223 | pr_warn("Size of skb exceeded MTU\n"); |
224 | kfree_skb(skb); | ||
223 | dev->stats.tx_errors++; | 225 | dev->stats.tx_errors++; |
224 | return -ENOSPC; | 226 | return NETDEV_TX_OK; |
225 | } | 227 | } |
226 | 228 | ||
227 | if (!priv->flowenabled) { | 229 | if (!priv->flowenabled) { |
228 | pr_debug("dropping packets flow off\n"); | 230 | pr_debug("dropping packets flow off\n"); |
231 | kfree_skb(skb); | ||
229 | dev->stats.tx_dropped++; | 232 | dev->stats.tx_dropped++; |
230 | return NETDEV_TX_BUSY; | 233 | return NETDEV_TX_OK; |
231 | } | 234 | } |
232 | 235 | ||
233 | if (priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP) | 236 | if (priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP) |
@@ -242,7 +245,7 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
242 | result = priv->chnl.dn->transmit(priv->chnl.dn, pkt); | 245 | result = priv->chnl.dn->transmit(priv->chnl.dn, pkt); |
243 | if (result) { | 246 | if (result) { |
244 | dev->stats.tx_dropped++; | 247 | dev->stats.tx_dropped++; |
245 | return result; | 248 | return NETDEV_TX_OK; |
246 | } | 249 | } |
247 | 250 | ||
248 | /* Update statistics. */ | 251 | /* Update statistics. */ |
diff --git a/net/core/dev.c b/net/core/dev.c index c25d453b2803..9bb8f87c4cda 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1409,14 +1409,34 @@ EXPORT_SYMBOL(register_netdevice_notifier); | |||
1409 | * register_netdevice_notifier(). The notifier is unlinked into the | 1409 | * register_netdevice_notifier(). The notifier is unlinked into the |
1410 | * kernel structures and may then be reused. A negative errno code | 1410 | * kernel structures and may then be reused. A negative errno code |
1411 | * is returned on a failure. | 1411 | * is returned on a failure. |
1412 | * | ||
1413 | * After unregistering unregister and down device events are synthesized | ||
1414 | * for all devices on the device list to the removed notifier to remove | ||
1415 | * the need for special case cleanup code. | ||
1412 | */ | 1416 | */ |
1413 | 1417 | ||
1414 | int unregister_netdevice_notifier(struct notifier_block *nb) | 1418 | int unregister_netdevice_notifier(struct notifier_block *nb) |
1415 | { | 1419 | { |
1420 | struct net_device *dev; | ||
1421 | struct net *net; | ||
1416 | int err; | 1422 | int err; |
1417 | 1423 | ||
1418 | rtnl_lock(); | 1424 | rtnl_lock(); |
1419 | err = raw_notifier_chain_unregister(&netdev_chain, nb); | 1425 | err = raw_notifier_chain_unregister(&netdev_chain, nb); |
1426 | if (err) | ||
1427 | goto unlock; | ||
1428 | |||
1429 | for_each_net(net) { | ||
1430 | for_each_netdev(net, dev) { | ||
1431 | if (dev->flags & IFF_UP) { | ||
1432 | nb->notifier_call(nb, NETDEV_GOING_DOWN, dev); | ||
1433 | nb->notifier_call(nb, NETDEV_DOWN, dev); | ||
1434 | } | ||
1435 | nb->notifier_call(nb, NETDEV_UNREGISTER, dev); | ||
1436 | nb->notifier_call(nb, NETDEV_UNREGISTER_BATCH, dev); | ||
1437 | } | ||
1438 | } | ||
1439 | unlock: | ||
1420 | rtnl_unlock(); | 1440 | rtnl_unlock(); |
1421 | return err; | 1441 | return err; |
1422 | } | 1442 | } |
diff --git a/net/key/af_key.c b/net/key/af_key.c index 11dbb2255ccb..7e5d927b576f 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -3480,7 +3480,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | |||
3480 | 3480 | ||
3481 | /* Addresses to be used by KM for negotiation, if ext is available */ | 3481 | /* Addresses to be used by KM for negotiation, if ext is available */ |
3482 | if (k != NULL && (set_sadb_kmaddress(skb, k) < 0)) | 3482 | if (k != NULL && (set_sadb_kmaddress(skb, k) < 0)) |
3483 | return -EINVAL; | 3483 | goto err; |
3484 | 3484 | ||
3485 | /* selector src */ | 3485 | /* selector src */ |
3486 | set_sadb_address(skb, sasize_sel, SADB_EXT_ADDRESS_SRC, sel); | 3486 | set_sadb_address(skb, sasize_sel, SADB_EXT_ADDRESS_SRC, sel); |
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 55670ec3cd0f..585d93ecee2d 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
@@ -232,7 +232,7 @@ static void l2tp_ip_close(struct sock *sk, long timeout) | |||
232 | { | 232 | { |
233 | write_lock_bh(&l2tp_ip_lock); | 233 | write_lock_bh(&l2tp_ip_lock); |
234 | hlist_del_init(&sk->sk_bind_node); | 234 | hlist_del_init(&sk->sk_bind_node); |
235 | hlist_del_init(&sk->sk_node); | 235 | sk_del_node_init(sk); |
236 | write_unlock_bh(&l2tp_ip_lock); | 236 | write_unlock_bh(&l2tp_ip_lock); |
237 | sk_common_release(sk); | 237 | sk_common_release(sk); |
238 | } | 238 | } |
@@ -271,7 +271,8 @@ static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
271 | chk_addr_ret != RTN_MULTICAST && chk_addr_ret != RTN_BROADCAST) | 271 | chk_addr_ret != RTN_MULTICAST && chk_addr_ret != RTN_BROADCAST) |
272 | goto out; | 272 | goto out; |
273 | 273 | ||
274 | inet->inet_rcv_saddr = inet->inet_saddr = addr->l2tp_addr.s_addr; | 274 | if (addr->l2tp_addr.s_addr) |
275 | inet->inet_rcv_saddr = inet->inet_saddr = addr->l2tp_addr.s_addr; | ||
275 | if (chk_addr_ret == RTN_MULTICAST || chk_addr_ret == RTN_BROADCAST) | 276 | if (chk_addr_ret == RTN_MULTICAST || chk_addr_ret == RTN_BROADCAST) |
276 | inet->inet_saddr = 0; /* Use device */ | 277 | inet->inet_saddr = 0; /* Use device */ |
277 | sk_dst_reset(sk); | 278 | sk_dst_reset(sk); |
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 9b9a85ecc4c7..bf5cf69c820a 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
@@ -331,23 +331,6 @@ static int __net_init phonet_init_net(struct net *net) | |||
331 | 331 | ||
332 | static void __net_exit phonet_exit_net(struct net *net) | 332 | static void __net_exit phonet_exit_net(struct net *net) |
333 | { | 333 | { |
334 | struct phonet_net *pnn = phonet_pernet(net); | ||
335 | struct net_device *dev; | ||
336 | unsigned i; | ||
337 | |||
338 | rtnl_lock(); | ||
339 | for_each_netdev(net, dev) | ||
340 | phonet_device_destroy(dev); | ||
341 | |||
342 | for (i = 0; i < 64; i++) { | ||
343 | dev = pnn->routes.table[i]; | ||
344 | if (dev) { | ||
345 | rtm_phonet_notify(RTM_DELROUTE, dev, i); | ||
346 | dev_put(dev); | ||
347 | } | ||
348 | } | ||
349 | rtnl_unlock(); | ||
350 | |||
351 | proc_net_remove(net, "phonet"); | 334 | proc_net_remove(net, "phonet"); |
352 | } | 335 | } |
353 | 336 | ||
@@ -361,7 +344,7 @@ static struct pernet_operations phonet_net_ops = { | |||
361 | /* Initialize Phonet devices list */ | 344 | /* Initialize Phonet devices list */ |
362 | int __init phonet_device_init(void) | 345 | int __init phonet_device_init(void) |
363 | { | 346 | { |
364 | int err = register_pernet_device(&phonet_net_ops); | 347 | int err = register_pernet_subsys(&phonet_net_ops); |
365 | if (err) | 348 | if (err) |
366 | return err; | 349 | return err; |
367 | 350 | ||
@@ -377,7 +360,7 @@ void phonet_device_exit(void) | |||
377 | { | 360 | { |
378 | rtnl_unregister_all(PF_PHONET); | 361 | rtnl_unregister_all(PF_PHONET); |
379 | unregister_netdevice_notifier(&phonet_device_notifier); | 362 | unregister_netdevice_notifier(&phonet_device_notifier); |
380 | unregister_pernet_device(&phonet_net_ops); | 363 | unregister_pernet_subsys(&phonet_net_ops); |
381 | proc_net_remove(&init_net, "pnresource"); | 364 | proc_net_remove(&init_net, "pnresource"); |
382 | } | 365 | } |
383 | 366 | ||