From c8f8e9c110d95fac30ed4984cdb154b3ccf2ca1c Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Sat, 3 Feb 2001 17:25:21 +0000 Subject: [PATCH] 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" --- sys/netinet/if_ether.c | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index c1237133c20..94d0c116f55 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -59,6 +59,10 @@ #include #include #include +#ifdef BRIDGE +#include +#include +#endif #include #include @@ -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)