diff options
author | alfred <alfred@FreeBSD.org> | 2001-01-06 00:45:08 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2001-01-06 00:45:08 +0000 |
commit | e06f071f56cf6badae9215f8a14ccc66a3fc0f5a (patch) | |
tree | 6992cd3e71fc90af88a9c22ec879aec34b89e843 | |
parent | 9615a9759434073fd9f29566eba28fc5c5214bc2 (diff) | |
download | FreeBSD-src-e06f071f56cf6badae9215f8a14ccc66a3fc0f5a.zip FreeBSD-src-e06f071f56cf6badae9215f8a14ccc66a3fc0f5a.tar.gz |
provide a sysctl 'net.link.ether.inet.log_arp_wrong_iface' to allow one
to supress logging when ARP replies arrive on the wrong interface:
"/kernel: arp: 1.2.3.4 is on dc0 but got reply from 00:00:c5:79:d0:0c on dc1"
the default is to log just to give notice about possibly incorrectly
configured networks.
-rw-r--r-- | sys/netinet/if_ether.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 1bbe164..c123713 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -493,6 +493,12 @@ arpintr() * We no longer reply to requests for ETHERTYPE_TRAIL protocol either, * but formerly didn't normally send requests. */ +static int log_arp_wrong_iface = 1; + +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_wrong_iface, CTLFLAG_RW, + &log_arp_wrong_iface, 0, + "log arp packets arriving on the wrong interface"); + static void in_arpinput(m) struct mbuf *m; @@ -558,6 +564,7 @@ in_arpinput(m) 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, |