--resend-on-iif status

Karel Rericha <[email protected]>
Newsgroups gmane.linux.network.bridge.ebtables.devel
Message-ID <[email protected]>
Hi,

I have tracked my problem with disabling traffic between wireless 
stations in hostap to allow
shaping this traffic with htb to

/br_forward.c/

probably to function


/static inline int should_deliver(struct net_bridge_port *p, struct 
sk_buff *skb)
{
    if (skb->dev == p->dev ||
        p->state != BR_STATE_FORWARDING)
            return 0;

    return 1;
}
/
If I get it right, bridge code doesn't send packets back to same 
physical interface, which is ok
for most of cases but alas not for wireless, where is essential to shape 
traffic between stations,
otherwise two heavily communicating stations (full speed download from 
one to other) can bring
stronger signal stations to pings about 200ms to AP, and moreover weaker 
signal stations are
losing packets at level reaching 80% (all measured for my case, but I 
assume others have same
symptoms too).

Hostap <http://hostap.epitest.fi/> has nice feature for disabling 
traffic between stations to let higher layers handle it, allowing
to use traffic shaping:

bridge_packets 0

But I have bridged wlan0 and eth0 on Mandrake 10.0 Community with kernel 
2.6.3 and as I said,
bridge doesn't send traffic back to same physical interface.

Joe Parks on hostap mailing list sent me a patch for br_forward.c (which 
I'm attaching), but I would
prefer more elegant way of doing things.

Yesterday I found on ebtables to-do list a notice about --resend-on-iif 
option, and I almost shouted
"That's it!". So I'm asking, how is it with --resend-on-iif status, will 
it be implemented in near future,
or is there any other way for forcing bridge to send appropriate packets 
back to same physical interface
they are originated from ?

Thanks alot,

Karel Rericha
obsolete-brforward.diff (text/plain, 1.3 KB)
--- linux/net/bridge/br_forward.c.lennert	2003-01-07 16:36:18.000000000 -0500
+++ linux/net/bridge/br_forward.c	2003-01-07 16:36:18.000000000 -0500
@@ -20,11 +20,42 @@
 #include <linux/if_bridge.h>
 #include <linux/netfilter_bridge.h>
 #include "br_private.h"
+#include <string.h>
+
+
+inline int isWlan(char *ifname) {
+  char *c = ifname + 4;
+  if (ifname == NULL) return 0;
+  if (strncmp(ifname, "wlan", 4)) return 0;
+  while (*c) {
+    if ((*c < '0') || (*c > '9')) return 0;
+    ++c;
+  }
+  return 1;
+}
+
 
 static inline int should_deliver(struct net_bridge_port *p, struct sk_buff *skb)
 {
-	if (skb->dev == p->dev ||
-	    p->state != BR_STATE_FORWARDING)
+
+/*
+ *     Marty Lamb 01/06/2003
+ *     modified forwarding decision to be based upon the combination of the
+ *     data's incoming physical device and bridge port number rather than the
+ *     physical device alone. 
+ *
+ *     Joe Parks 01/07/2003
+ *     Add an exception for devices named wlanX as these need special help
+ *     bridging to associated STAs.
+ */
+ 
+        if ( ( (skb->dev == p->dev)
+	        && ( (skb->dev->br_port == NULL)
+		     || (skb->dev->br_port->port_no == p->port_no)
+		   ) 
+		&& (!isWlan(skb->dev->name))
+              )
+	      || (p->state != BR_STATE_FORWARDING))
 		return 0;
 
 	return 1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.