bridge(4) as a loadable module.

Gary Allan dragonfly at
Mon Mar 21 08:25:06 PST 2005


Attached is a patch to treat bridge(4) as a loadable module and not as a 
compile time kernel option. This fixes the following problem.

ARP requests on bridged interfaces are not processed correctly when 
loading bridge(4) as a module.

How to repeat:
Load bridge(4) as a module and bridge two interfaces (fxp0, fxp1). 
Assign an IP address to fxp0. This IP address is inaccessible to devices 
attached to fxp1. Adding static ARP entries resolves the problem.



diff -ruN /usr/src.old/sys/dev/netif/snc/if_snc.c /usr/src/sys/dev/netif/snc/if_snc.c
--- /usr/src.old/sys/dev/netif/snc/if_snc.c	2005-02-19 15:47:44.000000000 +0000
+++ /usr/src/sys/dev/netif/snc/if_snc.c	2005-03-21 11:42:38.000000000 +0000
@@ -58,9 +58,7 @@
 #include <net/bpf.h>
 #include "opt_bdg.h"
-#ifdef BRIDGE
 #include <net/bridge/bridge.h>
 #include "dp83932reg.h"
 #include "dp83932var.h"
diff -ruN /usr/src.old/sys/netinet/if_ether.c /usr/src/sys/netinet/if_ether.c
--- /usr/src.old/sys/netinet/if_ether.c	2005-03-04 03:48:25.000000000 +0000
+++ /usr/src/sys/netinet/if_ether.c	2005-03-21 11:47:31.000000000 +0000
@@ -113,10 +113,8 @@
 #include <net/route.h>
 #include <net/netisr.h>
 #include <net/if_llc.h>
-#ifdef BRIDGE
 #include <net/ethernet.h>
 #include <net/bridge/bridge.h>
 #include <netinet/in.h>
 #include <netinet/in_var.h>
@@ -628,11 +626,9 @@
 	op = ntohs(ah->ar_op);
 	memcpy(&isaddr, ar_spa(ah), sizeof isaddr);
 	memcpy(&itaddr, ar_tpa(ah), sizeof itaddr);
-#ifdef BRIDGE
 #define BRIDGE_TEST (do_bridge)
-#define BRIDGE_TEST (0) /* cc will optimise the test away */
 	 * For a bridge, we want to check the address irrespective
 	 * of the receive interface. (This will change slightly

More information about the Submit mailing list