]>
Commit | Line | Data |
---|---|---|
8aa49427 DM |
1 | From d2615bf450694c1302d86b9cc8a8958edfe4c3a4 Mon Sep 17 00:00:00 2001 |
2 | From: Vlad Yasevich <vyasevic@redhat.com> | |
3 | Date: Wed, 20 Nov 2013 01:47:15 +0000 | |
4 | Subject: net: core: Always propagate flag changes to interfaces | |
5 | ||
6 | The following commit: | |
7 | b6c40d68ff6498b7f63ddf97cf0aa818d748dee7 | |
8 | net: only invoke dev->change_rx_flags when device is UP | |
9 | ||
10 | tried to fix a problem with VLAN devices and promiscuouse flag setting. | |
11 | The issue was that VLAN device was setting a flag on an interface that | |
12 | was down, thus resulting in bad promiscuity count. | |
13 | This commit blocked flag propagation to any device that is currently | |
14 | down. | |
15 | ||
16 | A later commit: | |
17 | deede2fabe24e00bd7e246eb81cd5767dc6fcfc7 | |
18 | vlan: Don't propagate flag changes on down interfaces | |
19 | ||
20 | fixed VLAN code to only propagate flags when the VLAN interface is up, | |
21 | thus fixing the same issue as above, only localized to VLAN. | |
22 | ||
23 | The problem we have now is that if we have create a complex stack | |
24 | involving multiple software devices like bridges, bonds, and vlans, | |
25 | then it is possible that the flags would not propagate properly to | |
26 | the physical devices. A simple examle of the scenario is the | |
27 | following: | |
28 | ||
29 | eth0----> bond0 ----> bridge0 ---> vlan50 | |
30 | ||
31 | If bond0 or eth0 happen to be down at the time bond0 is added to | |
32 | the bridge, then eth0 will never have promisc mode set which is | |
33 | currently required for operation as part of the bridge. As a | |
34 | result, packets with vlan50 will be dropped by the interface. | |
35 | ||
36 | The only 2 devices that implement the special flag handling are | |
37 | VLAN and DSA and they both have required code to prevent incorrect | |
38 | flag propagation. As a result we can remove the generic solution | |
39 | introduced in b6c40d68ff6498b7f63ddf97cf0aa818d748dee7 and leave | |
40 | it to the individual devices to decide whether they will block | |
41 | flag propagation or not. | |
42 | ||
43 | Reported-by: Stefan Priebe <s.priebe@profihost.ag> | |
44 | Suggested-by: Veaceslav Falico <vfalico@redhat.com> | |
45 | Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> | |
46 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
47 | --- | |
48 | (limited to 'net/core/dev.c') | |
49 | ||
50 | diff --git a/net/core/dev.c b/net/core/dev.c | |
51 | index 7e00a73..ba3b7ea 100644 | |
52 | --- a/net/core/dev.c | |
53 | +++ b/net/core/dev.c | |
54 | @@ -4996,7 +4996,7 @@ static void dev_change_rx_flags(struct net_device *dev, int flags) | |
55 | { | |
56 | const struct net_device_ops *ops = dev->netdev_ops; | |
57 | ||
58 | - if ((dev->flags & IFF_UP) && ops->ndo_change_rx_flags) | |
59 | + if (ops->ndo_change_rx_flags) | |
60 | ops->ndo_change_rx_flags(dev, flags); | |
61 | } | |
62 | ||
63 | -- | |
64 | cgit v0.9.2 |