From owner-freebsd-bugs Mon Apr 27 15:50:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA00816 for freebsd-bugs-outgoing; Mon, 27 Apr 1998 15:50:04 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA00808; Mon, 27 Apr 1998 15:50:02 -0700 (PDT) (envelope-from gnats) Received: from ntu-kpi.kiev.ua (root@ntu-kpi.kiev.ua [195.178.136.20]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA29070 for ; Mon, 27 Apr 1998 15:40:29 -0700 (PDT) (envelope-from lx@hosix.ntu-kpi.kiev.ua) Received: from fobos.ntu-kpi.kiev.ua (fobos.ntu-kpi.kiev.ua [10.100.0.6]) by ntu-kpi.kiev.ua (8.8.8/8.7.3) with ESMTP id BAA14367 for ; Tue, 28 Apr 1998 01:38:55 +0300 (EEST) Received: from hosix.ntu-kpi.kiev.ua (lx.hosix.ntu-kpi.kiev.ua [10.100.23.72]) by fobos.ntu-kpi.kiev.ua (unknown/censored) with ESMTP id BAA15417 for ; Tue, 28 Apr 1998 01:38:55 +0300 (EEST) Received: (from root@localhost) by hosix.ntu-kpi.kiev.ua (8.8.8/8.8.7) id BAA01959; Tue, 28 Apr 1998 01:38:19 +0300 (EEST) (envelope-from lx) Message-Id: <199804272238.BAA01959@hosix.ntu-kpi.kiev.ua> Date: Tue, 28 Apr 1998 01:38:19 +0300 (EEST) From: lx@hosix.ntu-kpi.kiev.ua Reply-To: lx@hosix.ntu-kpi.kiev.ua To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/6432: IFF_NOARP does not affect ethernet interfaces. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 6432 >Category: kern >Synopsis: IFF_NOARP does not affect ethernet interfaces. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 27 15:50:00 PDT 1998 >Last-Modified: >Originator: Alexander Matey >Organization: National Technical University of Ukraine /KPI/ >Release: FreeBSD 2.2.6-STABLE i386 >Environment: FreeBSD 2.2.6-STABLE, with ethernet network interfaces configured. >Description: Setting IFF_NOARP (by the help of ifconfig -arp) on a particular ethernet interface has no effect. This flag is ignored by the kernel for ethernet interfaces. >How-To-Repeat: Configure any ethernet interface. Set IFF_NOARP on it through ifconfig -arp. Then tcpdump -i arp host >Fix: Patch to netinet/if_ether.c included which fixes this. -DARP_HACK enables replies to who-has arp queries but still leaves requests disabled. --- /sys/netinet/if_ether.c.org Wed May 14 19:43:56 1997 +++ /sys/netinet/if_ether.c Sun Apr 26 16:47:25 1998 @@ -277,8 +277,14 @@ register struct ether_header *eh; register struct ether_arp *ea; struct sockaddr sa; +/* PATCH BEGIN -lx- */ + if((ac->ac_if.if_flags & IFF_NOARP) != 0) { + return; + } +/* PATCH END */ + if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL) return; m->m_len = sizeof(*ea); m->m_pkthdr.len = sizeof(*ea); @@ -353,8 +359,14 @@ sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) { bcopy(LLADDR(sdl), desten, sdl->sdl_alen); return 1; } +/* PATCH BEGIN -lx- */ + if((ac->ac_if.if_flags & IFF_NOARP) != 0) { + m_freem(m); + return (0); + } +/* PATCH END */ /* * There is an arptab entry, but no ethernet address * response yet. Replace the held mbuf with this * latest one. @@ -399,8 +411,13 @@ splx(s); if (m == 0 || (m->m_flags & M_PKTHDR) == 0) panic("arpintr"); if (m->m_len >= sizeof(struct arphdr) && +/* PATCH BEGIN -lx- */ +#ifndef ARP_HACK + (m->m_pkthdr.rcvif->if_flags & IFF_NOARP) == 0 && +#endif +/* PATCH END */ (ar = mtod(m, struct arphdr *)) && ntohs(ar->ar_hrd) == ARPHRD_ETHER && m->m_len >= sizeof(struct arphdr) + 2 * ar->ar_hln + 2 * ar->ar_pln) @@ -481,8 +498,16 @@ ea->arp_sha, ":", inet_ntoa(isaddr)); itaddr = myaddr; goto reply; } + +/* PATCH BEGIN -lx- */ +#ifdef ARP_HACK + if ((ac->ac_if.if_flags & IFF_NOARP) != 0) { + goto reply; + } +#endif +/* PATCH END */ la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0); if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) { if (sdl->sdl_alen && bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen)) >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message