From owner-freebsd-hackers Mon Sep 3 14:39:20 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from server1.lordlegacy.org (lordlegacy.org [209.61.182.147]) by hub.freebsd.org (Postfix) with ESMTP id 12B4A37B406 for ; Mon, 3 Sep 2001 14:39:17 -0700 (PDT) Received: from sharon ([216.13.207.127]) by server1.lordlegacy.org (8.9.3/8.9.3) with SMTP id LAA13323 for ; Mon, 3 Sep 2001 11:49:34 -0500 From: "Stephen Hurd" To: "FreeBSD-Hackers" Subject: Patch to allow disabling logging of arp movements through sysctl Date: Mon, 3 Sep 2001 15:43:41 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I've had a problem with my DSL connection for some time now, the bridging they use appears to forward arp responses AND respond to arp requests. This ends up filling my log with: Sep 3 15:17:57 tw2 /kernel: arp: 216.13.207.2 moved from 00:06:29:d5:04:c7 to 00:10:b5:4f:d1:1a on rl0 Sep 3 15:17:57 tw2 /kernel: arp: 216.13.207.2 moved from 00:10:b5:4f:d1:1a to 00:06:29:d5:04:c7 on rl0 I've dug around on the list archives, and it looks like I'm not the first person to get annoyed at this, but I haven't found a solution. So, I've finally gotten so annoyed at my huge logs that I broke down and added the following patch to add the sysctl variable net.link.ether.inet.log_arp_movements Is this the "right place" to send the patch or should I file a PR? --- /usr/src/sys/netinet/if_ether.c.old Mon Sep 3 14:26:38 2001 +++ /usr/src/sys/netinet/if_ether.c Mon Sep 3 15:13:08 2001 @@ -497,10 +497,15 @@ * but formerly didn't normally send requests. */ static int log_arp_wrong_iface = 1; +static int log_arp_movements = 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"); +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_movements, CTLFLAG_RW, + &log_arp_movements, 0, + "log arp replies from MACs different the the one in the cache"); + static void in_arpinput(m) @@ -586,12 +591,13 @@ } if (sdl->sdl_alen && bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen)) { - if (rt->rt_expire) - log(LOG_INFO, "arp: %s moved from %6D to %6D on %s%d\n", - inet_ntoa(isaddr), (u_char *)LLADDR(sdl), ":", - ea->arp_sha, ":", - ac->ac_if.if_name, ac->ac_if.if_unit); - else { + if (rt->rt_expire) { + if (log_arp_movements) + log(LOG_INFO, "arp: %s moved from %6D to %6D on %s%d\n", + inet_ntoa(isaddr), (u_char *)LLADDR(sdl), ":", + ea->arp_sha, ":", + ac->ac_if.if_name, ac->ac_if.if_unit); + } else { log(LOG_ERR, "arp: %6D attempts to modify permanent entry for %s on %s%d\n", ea->arp_sha, ":", inet_ntoa(isaddr), To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message