Hi,

I had a look at the code, and this doesn't seem to be its only problem.
For one, all frames are passed up if the interface is in promiscuous mode
(which causes the acceptance of multicast packets on blocking ports if
tcpdump is running :/).  Another problem is that MAC addresses on spanning
tree packets aren't learned.  How does this diff look?  I'll send it off
to Dave Miller if noone complains in a few days.

Thanks for the bug report, sorry for the delay.


cheers,
Lennert


--- br_input.c.orig     Fri Dec  7 21:11:27 2001
+++ br_input.c  Fri Dec  7 21:12:48 2001
@@ -69,6 +69,8 @@
 
                skb2 = skb_clone(skb, GFP_ATOMIC);
                if (skb2) {
+                       if (p->state != BR_STATE_FORWARDING)
+                               skb2->pkt_type = PACKET_OTHERHOST;
                        passedup = 1;
                        br_pass_frame_up(br, skb2);
                }
@@ -77,36 +79,22 @@
        if (skb->mac.ethernet->h_source[0] & 1)
                goto freeandout;
 
-       if (!passedup &&
-           (dest[0] & 1) &&
-           (br->dev.flags & IFF_ALLMULTI || br->dev.mc_list != NULL)) {
-               struct sk_buff *skb2;
-
-               skb2 = skb_clone(skb, GFP_ATOMIC);
-               if (skb2) {
-                       passedup = 1;
-                       br_pass_frame_up(br, skb2);
-               }
-       }
+       if (p->state == BR_STATE_LEARNING ||
+           p->state == BR_STATE_FORWARDING)
+               br_fdb_insert(br, p, skb->mac.ethernet->h_source, 0);
 
        if (br->stp_enabled &&
            !memcmp(dest, bridge_ula, 5) &&
            !(dest[5] & 0xF0))
                goto handle_special_frame;
 
-       if (p->state == BR_STATE_LEARNING ||
-           p->state == BR_STATE_FORWARDING)
-               br_fdb_insert(br, p, skb->mac.ethernet->h_source, 0);
-
        if (p->state != BR_STATE_FORWARDING)
                goto freeandout;
 
        if (dest[0] & 1) {
-               br_flood_forward(br, skb, 1);
+               br_flood_forward(br, skb, !passedup);
                if (!passedup)
                        br_pass_frame_up(br, skb);
-               else
-                       kfree_skb(skb);
                return;
        }
 


On Fri, Dec 07, 2001 at 11:32:46AM -0800, David Kimdon wrote:

> Hi,
> 
> In a mail I sent last Friday:
> http://www.math.leidenuniv.nl/pipermail/bridge/2001-November/001162.html
> 
> I include a proposed patch to the bridge.
> 
> I wonder if anyone has comments on my proposed patch, or an
> explanation why the patch isn't needed.  I'm confused because without
> that patch I'm getting a lot of packet duplication since blocking
> ports accept broadcast and multicast packets (note that spanning tree
> protocol packets are handled a bit further down.)
> 
> Thanks for your time,
> 
> David
> 
_______________________________________________
Bridge mailing list
[EMAIL PROTECTED]
http://www.math.leidenuniv.nl/mailman/listinfo/bridge

Reply via email to