View | Details | Raw Unified | Return to bug 24720
Collapse All | Expand All

(-)sys/netinet/if_ether.c (-16 / +26 lines)
Lines 59-64 Link Here
59
#include <net/route.h>
59
#include <net/route.h>
60
#include <net/netisr.h>
60
#include <net/netisr.h>
61
#include <net/if_llc.h>
61
#include <net/if_llc.h>
62
#ifdef BRIDGE
63
#include <net/ethernet.h>
64
#include <net/bridge.h>
65
#endif
62
66
63
#include <netinet/in.h>
67
#include <netinet/in.h>
64
#include <netinet/in_var.h>
68
#include <netinet/in_var.h>
Lines 525-538 Link Here
525
		 * of the receive interface. (This will change slightly
529
		 * of the receive interface. (This will change slightly
526
		 * when we have clusters of interfaces).
530
		 * when we have clusters of interfaces).
527
		 */
531
		 */
528
		{
532
		if (!do_bridge) {
529
#else
533
#else
530
		if (ia->ia_ifp == &ac->ac_if) {
534
		{
531
#endif
535
#endif
532
			maybe_ia = ia;
536
			if (ia->ia_ifp == &ac->ac_if) {
533
			if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
537
				maybe_ia = ia;
534
			     (isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
538
				if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
535
				break;
539
				     (isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
540
					break;
541
			}
536
		}
542
		}
537
	if (maybe_ia == 0) {
543
	if (maybe_ia == 0) {
538
		m_freem(m);
544
		m_freem(m);
Lines 561-577 Link Here
561
	}
567
	}
562
	la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
568
	la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
563
	if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
569
	if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
564
#ifndef BRIDGE /* the following is not an error when doing bridging */
570
#ifdef BRIDGE 
565
		if (rt->rt_ifp != &ac->ac_if) {
571
		if (!do_bridge) { /* the following is not an error when doing bridging */
566
			if (log_arp_wrong_iface)
572
#else
567
			log(LOG_ERR, "arp: %s is on %s%d but got reply from %6D on %s%d\n",
573
		{
568
			    inet_ntoa(isaddr),
569
			    rt->rt_ifp->if_name, rt->rt_ifp->if_unit,
570
			    ea->arp_sha, ":",
571
			    ac->ac_if.if_name, ac->ac_if.if_unit);
572
			goto reply;
573
		}
574
#endif
574
#endif
575
			if (rt->rt_ifp != &ac->ac_if) {
576
				if (log_arp_wrong_iface)
577
				log(LOG_ERR, "arp: %s is on %s%d but got reply from %6D on %s%d\n",
578
				    inet_ntoa(isaddr),
579
				    rt->rt_ifp->if_name, rt->rt_ifp->if_unit,
580
				    ea->arp_sha, ":",
581
				    ac->ac_if.if_name, ac->ac_if.if_unit);
582
				goto reply;
583
			}
584
		}
575
		if (sdl->sdl_alen &&
585
		if (sdl->sdl_alen &&
576
		    bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen)) {
586
		    bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen)) {
577
			if (rt->rt_expire)
587
			if (rt->rt_expire)

Return to bug 24720