tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/18035 IFF_SIMPLEX vs bridge(4)



> I think "bridge doesn't learn MACs from broadcast packets" is a
> reasonable approximation to a fix.

It is.  I tried that and, while I still see the ARP request duplicated
when tcpdumping vr0, I no longer see bridge1 learning MAC addresses on
the wrong interface.

The patch I got this effect with is almost ludicrously simple:

--- /dev/fd/4   Tue Dec  9 16:18:08 2003
+++ /dev/fd/5   Tue Dec  9 16:18:08 2003
@@ -1360,10 +1360,12 @@
        /*
         * If the interface is learning, and the source
         * address is valid and not multicast, record
-        * the address.
+        * the address.  But don't do this if the destination
+        * is broadcast; such packets are looped back too often.
         */
        if ((bif->bif_flags & IFBIF_LEARNING) != 0 &&
            ETHER_IS_MULTICAST(eh->ether_shost) == 0 &&
+           
memcmp(etherbroadcastaddr,eh->ether_dhost,sizeof(etherbroadcastaddr)) &&
            (eh->ether_shost[0] == 0 &&
             eh->ether_shost[1] == 0 &&
             eh->ether_shost[2] == 0 &&

I'm sending a bcc of this mail, too, to the PR, so's to ensure the
patch is there for anyone who wants it.  (The above is relative to
stock 4.0 source, if_bridge.c,v 1.46.)

/~\ The ASCII                           der Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index