Hi,

If you modify should_deliver, that will also cause broadcast
packets to be echoed back to their originating port, and you
really don't want that.

Something like the attached patch should do the trick (warning,
untested).


cheers,
Lennert



--- br_forward.c.orig   Thu Apr 18 09:05:42 2002
+++ br_forward.c        Thu Apr 18 09:05:32 2002
@@ -30,6 +30,14 @@
        return 1;
 }
 
+static inline int should_deliver_for_adam(struct net_bridge_port *p, struct sk_buff 
+*skb)
+{
+       if (p->state != BR_STATE_FORWARDING)
+               return 0;
+
+       return 1;
+}
+
 static int __dev_queue_push_xmit(struct sk_buff *skb)
 {
        skb_push(skb, ETH_HLEN);
@@ -82,7 +90,7 @@
 /* called under bridge lock */
 void br_forward(struct net_bridge_port *to, struct sk_buff *skb)
 {
-       if (should_deliver(to, skb)) {
+       if (should_deliver_for_adam(to, skb)) {
                __br_forward(to, skb);
                return;
        }




On Wed, Apr 17, 2002 at 04:15:25PM -0700, Adam Fineberg wrote:

> I wanted to do an experiment where the bridge would echo a
> packet out the source port if the destination resided on the
> source port.  It seems like the should_deliver function is
> what prevents this from happening in normal use.  Does anyone
> know if disabling the should_deliver so it always returns a
> 1 will provide this outcome or is there a better way?
> 
> Thanks for any help,
> Adam Fineberg
_______________________________________________
Bridge mailing list
[EMAIL PROTECTED]
http://www.math.leidenuniv.nl/mailman/listinfo/bridge

Reply via email to