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.
This commit is contained in:
alfred 2001-01-06 00:45:08 +00:00
parent 492b865ced
commit ebc1de0a18

View File

@ -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,