From cfbe2fd3f720064a5107704865ff523b8453bad9 Mon Sep 17 00:00:00 2001 From: glebius Date: Sun, 18 Dec 2005 19:11:56 +0000 Subject: Add a knob to suppress logging of attempts to modify permanent ARP entries. Submitted by: Andrew Alcheyev --- sys/netinet/if_ether.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'sys/netinet/if_ether.c') diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 23ee429..28f7d44 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -570,6 +570,7 @@ arpintr(struct mbuf *m) */ static int log_arp_wrong_iface = 1; static int log_arp_movements = 1; +static int log_arp_permanent_modify = 1; SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_wrong_iface, CTLFLAG_RW, &log_arp_wrong_iface, 0, @@ -577,6 +578,9 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_wrong_iface, CTLFLAG_RW, SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_movements, CTLFLAG_RW, &log_arp_movements, 0, "log arp replies from MACs different than the one in the cache"); +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_permanent_modify, CTLFLAG_RW, + &log_arp_permanent_modify, 0, + "log arp replies from MACs different than the one in the permanent arp entry"); static void @@ -721,12 +725,13 @@ match: ifp->if_addrlen, (u_char *)ar_sha(ah), ":", ifp->if_xname); } else { - log(LOG_ERR, - "arp: %*D attempts to modify permanent entry for %s on %s\n", - ifp->if_addrlen, (u_char *)ar_sha(ah), ":", - inet_ntoa(isaddr), ifp->if_xname); - RT_UNLOCK(rt); - goto reply; + RT_UNLOCK(rt); + if (log_arp_permanent_modify) + log(LOG_ERR, "arp: %*D attempts to modify " + "permanent entry for %s on %s\n", + ifp->if_addrlen, (u_char *)ar_sha(ah), ":", + inet_ntoa(isaddr), ifp->if_xname); + goto reply; } } /* -- cgit v1.1