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