diff options
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index e8eb2b478344..fd992c0f2717 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2918,6 +2918,12 @@ int netdev_set_master(struct net_device *slave, struct net_device *master) | |||
2918 | return 0; | 2918 | return 0; |
2919 | } | 2919 | } |
2920 | 2920 | ||
2921 | static void dev_change_rx_flags(struct net_device *dev, int flags) | ||
2922 | { | ||
2923 | if (dev->flags & IFF_UP && dev->change_rx_flags) | ||
2924 | dev->change_rx_flags(dev, flags); | ||
2925 | } | ||
2926 | |||
2921 | static int __dev_set_promiscuity(struct net_device *dev, int inc) | 2927 | static int __dev_set_promiscuity(struct net_device *dev, int inc) |
2922 | { | 2928 | { |
2923 | unsigned short old_flags = dev->flags; | 2929 | unsigned short old_flags = dev->flags; |
@@ -2955,8 +2961,7 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc) | |||
2955 | current->uid, current->gid, | 2961 | current->uid, current->gid, |
2956 | audit_get_sessionid(current)); | 2962 | audit_get_sessionid(current)); |
2957 | 2963 | ||
2958 | if (dev->change_rx_flags) | 2964 | dev_change_rx_flags(dev, IFF_PROMISC); |
2959 | dev->change_rx_flags(dev, IFF_PROMISC); | ||
2960 | } | 2965 | } |
2961 | return 0; | 2966 | return 0; |
2962 | } | 2967 | } |
@@ -3022,8 +3027,7 @@ int dev_set_allmulti(struct net_device *dev, int inc) | |||
3022 | } | 3027 | } |
3023 | } | 3028 | } |
3024 | if (dev->flags ^ old_flags) { | 3029 | if (dev->flags ^ old_flags) { |
3025 | if (dev->change_rx_flags) | 3030 | dev_change_rx_flags(dev, IFF_ALLMULTI); |
3026 | dev->change_rx_flags(dev, IFF_ALLMULTI); | ||
3027 | dev_set_rx_mode(dev); | 3031 | dev_set_rx_mode(dev); |
3028 | } | 3032 | } |
3029 | return 0; | 3033 | return 0; |
@@ -3347,8 +3351,8 @@ int dev_change_flags(struct net_device *dev, unsigned flags) | |||
3347 | * Load in the correct multicast list now the flags have changed. | 3351 | * Load in the correct multicast list now the flags have changed. |
3348 | */ | 3352 | */ |
3349 | 3353 | ||
3350 | if (dev->change_rx_flags && (old_flags ^ flags) & IFF_MULTICAST) | 3354 | if ((old_flags ^ flags) & IFF_MULTICAST) |
3351 | dev->change_rx_flags(dev, IFF_MULTICAST); | 3355 | dev_change_rx_flags(dev, IFF_MULTICAST); |
3352 | 3356 | ||
3353 | dev_set_rx_mode(dev); | 3357 | dev_set_rx_mode(dev); |
3354 | 3358 | ||