summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_ether.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-02-03 17:25:21 +0000
committerjulian <julian@FreeBSD.org>2001-02-03 17:25:21 +0000
commitda7b413f65c65992ee6e3dd8219e1ac9684a3f38 (patch)
tree2c8e397ffcece63ba8d33268ac96df6f2bb6168d /sys/netinet/if_ether.c
parent408a00d7df90965db4085ccfd67356bf3f7c38ee (diff)
downloadFreeBSD-src-da7b413f65c65992ee6e3dd8219e1ac9684a3f38.zip
FreeBSD-src-da7b413f65c65992ee6e3dd8219e1ac9684a3f38.tar.gz
Make the code act the same in the case of BRIDGE being defined, but not
turned on, and the case of it not being defined at all. i.e. Disabling bridging re-enables some of the checks it disables. Submitted by: "Rogier R. Mulhuijzen" <drwilco@drwilco.net>
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r--sys/netinet/if_ether.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index c123713..94d0c11 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -59,6 +59,10 @@
#include <net/route.h>
#include <net/netisr.h>
#include <net/if_llc.h>
+#ifdef BRIDGE
+#include <net/ethernet.h>
+#include <net/bridge.h>
+#endif
#include <netinet/in.h>
#include <netinet/in_var.h>
@@ -526,14 +530,16 @@ in_arpinput(m)
* of the receive interface. (This will change slightly
* when we have clusters of interfaces).
*/
- {
+ if (!do_bridge) {
#else
- if (ia->ia_ifp == &ac->ac_if) {
+ {
#endif
- maybe_ia = ia;
- if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
- (isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
- break;
+ if (ia->ia_ifp == &ac->ac_if) {
+ maybe_ia = ia;
+ if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
+ (isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
+ break;
+ }
}
if (maybe_ia == 0) {
m_freem(m);
@@ -562,17 +568,21 @@ in_arpinput(m)
}
la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
-#ifndef BRIDGE /* the following is not an error when doing bridging */
- if (rt->rt_ifp != &ac->ac_if) {
- if (log_arp_wrong_iface)
- log(LOG_ERR, "arp: %s is on %s%d but got reply from %6D on %s%d\n",
- inet_ntoa(isaddr),
- rt->rt_ifp->if_name, rt->rt_ifp->if_unit,
- ea->arp_sha, ":",
- ac->ac_if.if_name, ac->ac_if.if_unit);
- goto reply;
- }
+#ifdef BRIDGE
+ if (!do_bridge) { /* the following is not an error when doing bridging */
+#else
+ {
#endif
+ if (rt->rt_ifp != &ac->ac_if) {
+ if (log_arp_wrong_iface)
+ log(LOG_ERR, "arp: %s is on %s%d but got reply from %6D on %s%d\n",
+ inet_ntoa(isaddr),
+ rt->rt_ifp->if_name, rt->rt_ifp->if_unit,
+ ea->arp_sha, ":",
+ ac->ac_if.if_name, ac->ac_if.if_unit);
+ goto reply;
+ }
+ }
if (sdl->sdl_alen &&
bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen)) {
if (rt->rt_expire)
OpenPOWER on IntegriCloud