Thread (23 messages) 23 messages, 4 authors, 2008-07-02

Re: [PATCH 3/3] netdevice: order of synchronization of IFF_PROMISC and IFF_ALLMULTI

From: Wang Chen <hidden>
Date: 2008-06-16 09:43:15

Patrick McHardy said the following on 2008-6-16 17:27:
Wang Chen wrote:
quoted
IFF_PROMISC should be set before IFF_ALLMULTI.

Signed-off-by: Wang Chen <redacted>
---
 net/8021q/vlan_dev.c |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 5d055c2..14742e3 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -547,10 +547,14 @@ static int vlan_dev_open(struct net_device *dev)
     }
     memcpy(vlan->real_dev_addr, real_dev->dev_addr, ETH_ALEN);
 
-    if (dev->flags & IFF_ALLMULTI)
-        dev_set_allmulti(real_dev, 1);
+    /* NOTE: order of synchronization of IFF_PROMISC and IFF_ALLMULTI
+       is important. Some (broken) drivers set IFF_PROMISC, when
+       IFF_ALLMULTI is requested not asking us and not reporting.
+     */
     if (dev->flags & IFF_PROMISC)
         dev_set_promiscuity(real_dev, 1);
+    if (dev->flags & IFF_ALLMULTI)
+        dev_set_allmulti(real_dev, 1);

What exactly is the problem here? The VLAN code is obviously not
one of the broken drivers, so why should it care what other drivers
do?
I think the problem is that allmulti is not valid if promis is not on.

And about the comment, I copy it from dev_change_flags() and think
it seems suit for here.
Did I misunderstand this comment?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help