diff options
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r-- | drivers/net/macvlan.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index d7c0bc62da7f..07bcb8084d78 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -70,16 +70,17 @@ static void macvlan_hash_add(struct macvlan_dev *vlan) | |||
70 | hlist_add_head_rcu(&vlan->hlist, &port->vlan_hash[addr[5]]); | 70 | hlist_add_head_rcu(&vlan->hlist, &port->vlan_hash[addr[5]]); |
71 | } | 71 | } |
72 | 72 | ||
73 | static void macvlan_hash_del(struct macvlan_dev *vlan) | 73 | static void macvlan_hash_del(struct macvlan_dev *vlan, bool sync) |
74 | { | 74 | { |
75 | hlist_del_rcu(&vlan->hlist); | 75 | hlist_del_rcu(&vlan->hlist); |
76 | synchronize_rcu(); | 76 | if (sync) |
77 | synchronize_rcu(); | ||
77 | } | 78 | } |
78 | 79 | ||
79 | static void macvlan_hash_change_addr(struct macvlan_dev *vlan, | 80 | static void macvlan_hash_change_addr(struct macvlan_dev *vlan, |
80 | const unsigned char *addr) | 81 | const unsigned char *addr) |
81 | { | 82 | { |
82 | macvlan_hash_del(vlan); | 83 | macvlan_hash_del(vlan, true); |
83 | /* Now that we are unhashed it is safe to change the device | 84 | /* Now that we are unhashed it is safe to change the device |
84 | * address without confusing packet delivery. | 85 | * address without confusing packet delivery. |
85 | */ | 86 | */ |
@@ -345,7 +346,7 @@ static int macvlan_stop(struct net_device *dev) | |||
345 | dev_uc_del(lowerdev, dev->dev_addr); | 346 | dev_uc_del(lowerdev, dev->dev_addr); |
346 | 347 | ||
347 | hash_del: | 348 | hash_del: |
348 | macvlan_hash_del(vlan); | 349 | macvlan_hash_del(vlan, !dev->dismantle); |
349 | return 0; | 350 | return 0; |
350 | } | 351 | } |
351 | 352 | ||