diff options
Diffstat (limited to 'net/core/dev.c')
| -rw-r--r-- | net/core/dev.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 0640d2a859c..b1e6d638551 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -1466,8 +1466,7 @@ EXPORT_SYMBOL(unregister_netdevice_notifier); | |||
| 1466 | 1466 | ||
| 1467 | int call_netdevice_notifiers(unsigned long val, struct net_device *dev) | 1467 | int call_netdevice_notifiers(unsigned long val, struct net_device *dev) |
| 1468 | { | 1468 | { |
| 1469 | if (val != NETDEV_UNREGISTER_FINAL) | 1469 | ASSERT_RTNL(); |
| 1470 | ASSERT_RTNL(); | ||
| 1471 | return raw_notifier_call_chain(&netdev_chain, val, dev); | 1470 | return raw_notifier_call_chain(&netdev_chain, val, dev); |
| 1472 | } | 1471 | } |
| 1473 | EXPORT_SYMBOL(call_netdevice_notifiers); | 1472 | EXPORT_SYMBOL(call_netdevice_notifiers); |
| @@ -2185,9 +2184,7 @@ EXPORT_SYMBOL(netif_skb_features); | |||
| 2185 | /* | 2184 | /* |
| 2186 | * Returns true if either: | 2185 | * Returns true if either: |
| 2187 | * 1. skb has frag_list and the device doesn't support FRAGLIST, or | 2186 | * 1. skb has frag_list and the device doesn't support FRAGLIST, or |
| 2188 | * 2. skb is fragmented and the device does not support SG, or if | 2187 | * 2. skb is fragmented and the device does not support SG. |
| 2189 | * at least one of fragments is in highmem and device does not | ||
| 2190 | * support DMA from it. | ||
| 2191 | */ | 2188 | */ |
| 2192 | static inline int skb_needs_linearize(struct sk_buff *skb, | 2189 | static inline int skb_needs_linearize(struct sk_buff *skb, |
| 2193 | int features) | 2190 | int features) |
| @@ -4521,8 +4518,8 @@ static void dev_change_rx_flags(struct net_device *dev, int flags) | |||
| 4521 | static int __dev_set_promiscuity(struct net_device *dev, int inc) | 4518 | static int __dev_set_promiscuity(struct net_device *dev, int inc) |
| 4522 | { | 4519 | { |
| 4523 | unsigned int old_flags = dev->flags; | 4520 | unsigned int old_flags = dev->flags; |
| 4524 | uid_t uid; | 4521 | kuid_t uid; |
| 4525 | gid_t gid; | 4522 | kgid_t gid; |
| 4526 | 4523 | ||
| 4527 | ASSERT_RTNL(); | 4524 | ASSERT_RTNL(); |
| 4528 | 4525 | ||
| @@ -4554,7 +4551,8 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc) | |||
| 4554 | dev->name, (dev->flags & IFF_PROMISC), | 4551 | dev->name, (dev->flags & IFF_PROMISC), |
| 4555 | (old_flags & IFF_PROMISC), | 4552 | (old_flags & IFF_PROMISC), |
| 4556 | audit_get_loginuid(current), | 4553 | audit_get_loginuid(current), |
| 4557 | uid, gid, | 4554 | from_kuid(&init_user_ns, uid), |
| 4555 | from_kgid(&init_user_ns, gid), | ||
| 4558 | audit_get_sessionid(current)); | 4556 | audit_get_sessionid(current)); |
| 4559 | } | 4557 | } |
| 4560 | 4558 | ||
| @@ -5649,6 +5647,8 @@ int register_netdevice(struct net_device *dev) | |||
| 5649 | 5647 | ||
| 5650 | set_bit(__LINK_STATE_PRESENT, &dev->state); | 5648 | set_bit(__LINK_STATE_PRESENT, &dev->state); |
| 5651 | 5649 | ||
| 5650 | linkwatch_init_dev(dev); | ||
| 5651 | |||
| 5652 | dev_init_scheduler(dev); | 5652 | dev_init_scheduler(dev); |
| 5653 | dev_hold(dev); | 5653 | dev_hold(dev); |
| 5654 | list_netdevice(dev); | 5654 | list_netdevice(dev); |
| @@ -5782,7 +5782,11 @@ static void netdev_wait_allrefs(struct net_device *dev) | |||
| 5782 | 5782 | ||
| 5783 | /* Rebroadcast unregister notification */ | 5783 | /* Rebroadcast unregister notification */ |
| 5784 | call_netdevice_notifiers(NETDEV_UNREGISTER, dev); | 5784 | call_netdevice_notifiers(NETDEV_UNREGISTER, dev); |
| 5785 | |||
| 5786 | __rtnl_unlock(); | ||
| 5785 | rcu_barrier(); | 5787 | rcu_barrier(); |
| 5788 | rtnl_lock(); | ||
| 5789 | |||
| 5786 | call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL, dev); | 5790 | call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL, dev); |
| 5787 | if (test_bit(__LINK_STATE_LINKWATCH_PENDING, | 5791 | if (test_bit(__LINK_STATE_LINKWATCH_PENDING, |
| 5788 | &dev->state)) { | 5792 | &dev->state)) { |
| @@ -5855,7 +5859,9 @@ void netdev_run_todo(void) | |||
| 5855 | = list_first_entry(&list, struct net_device, todo_list); | 5859 | = list_first_entry(&list, struct net_device, todo_list); |
| 5856 | list_del(&dev->todo_list); | 5860 | list_del(&dev->todo_list); |
| 5857 | 5861 | ||
| 5862 | rtnl_lock(); | ||
| 5858 | call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL, dev); | 5863 | call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL, dev); |
| 5864 | __rtnl_unlock(); | ||
| 5859 | 5865 | ||
| 5860 | if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) { | 5866 | if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) { |
| 5861 | pr_err("network todo '%s' but state %d\n", | 5867 | pr_err("network todo '%s' but state %d\n", |
| @@ -6251,6 +6257,8 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char | |||
| 6251 | the device is just moving and can keep their slaves up. | 6257 | the device is just moving and can keep their slaves up. |
| 6252 | */ | 6258 | */ |
| 6253 | call_netdevice_notifiers(NETDEV_UNREGISTER, dev); | 6259 | call_netdevice_notifiers(NETDEV_UNREGISTER, dev); |
| 6260 | rcu_barrier(); | ||
| 6261 | call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL, dev); | ||
| 6254 | rtmsg_ifinfo(RTM_DELLINK, dev, ~0U); | 6262 | rtmsg_ifinfo(RTM_DELLINK, dev, ~0U); |
| 6255 | 6263 | ||
| 6256 | /* | 6264 | /* |
