aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 2b67f2aa59dd..f409406254dd 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1184,7 +1184,21 @@ int dev_change_name(struct net_device *dev, const char *newname)
1184 BUG_ON(!dev_net(dev)); 1184 BUG_ON(!dev_net(dev));
1185 1185
1186 net = dev_net(dev); 1186 net = dev_net(dev);
1187 if (dev->flags & IFF_UP) 1187
1188 /* Some auto-enslaved devices e.g. failover slaves are
1189 * special, as userspace might rename the device after
1190 * the interface had been brought up and running since
1191 * the point kernel initiated auto-enslavement. Allow
1192 * live name change even when these slave devices are
1193 * up and running.
1194 *
1195 * Typically, users of these auto-enslaving devices
1196 * don't actually care about slave name change, as
1197 * they are supposed to operate on master interface
1198 * directly.
1199 */
1200 if (dev->flags & IFF_UP &&
1201 likely(!(dev->priv_flags & IFF_LIVE_RENAME_OK)))
1188 return -EBUSY; 1202 return -EBUSY;
1189 1203
1190 write_seqcount_begin(&devnet_rename_seq); 1204 write_seqcount_begin(&devnet_rename_seq);
@@ -5014,8 +5028,10 @@ static inline void __netif_receive_skb_list_ptype(struct list_head *head,
5014 if (pt_prev->list_func != NULL) 5028 if (pt_prev->list_func != NULL)
5015 pt_prev->list_func(head, pt_prev, orig_dev); 5029 pt_prev->list_func(head, pt_prev, orig_dev);
5016 else 5030 else
5017 list_for_each_entry_safe(skb, next, head, list) 5031 list_for_each_entry_safe(skb, next, head, list) {
5032 skb_list_del_init(skb);
5018 pt_prev->func(skb, skb->dev, pt_prev, orig_dev); 5033 pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
5034 }
5019} 5035}
5020 5036
5021static void __netif_receive_skb_list_core(struct list_head *head, bool pfmemalloc) 5037static void __netif_receive_skb_list_core(struct list_head *head, bool pfmemalloc)