bridge(4) as a loadable module.
This is a multi-part message in MIME format.
--------------000605050305000701070805
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hello,
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.
Bug:
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.
Regards
Gary
--------------000605050305000701070805
Content-Type: text/plain;
name="patch.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch.diff"
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>
-#endif
#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>
-#endif
#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)
-#else
-#define BRIDGE_TEST (0) /* cc will optimise the test away */
-#endif
+
/*
* For a bridge, we want to check the address irrespective
* of the receive interface. (This will change slightly
--------------000605050305000701070805--
討論串 (同標題文章)