From owner-freebsd-bugs Sun Apr 4 5: 2: 3 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id E7BFD14D94 for ; Sun, 4 Apr 1999 05:01:57 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id FAA82416; Sun, 4 Apr 1999 05:00:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Sun, 4 Apr 1999 05:00:01 -0700 (PDT) Message-Id: <199904041200.FAA82416@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Alexander Matey Subject: Re: kern/6432: IFF_NOARP does not affect ethernet interfaces Reply-To: Alexander Matey Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/6432; it has been noted by GNATS. From: Alexander Matey To: bug-followup@FreeBSD.ORG Cc: Subject: Re: kern/6432: IFF_NOARP does not affect ethernet interfaces Date: Sun, 4 Apr 1999 14:49:56 +0300 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Hello, This is a carefully reviewed and updated version of the patch set included in the original PR. I've removed unnecessary comments, followed the style of the original files and included additional patches to LINT and conf/options. Patches were made and tested against a fresh 3.1-STABLE. -- Alexander Matey Kyiv, Ukraine --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="static_arp.diff" diff -cr sys/conf/options sys.new/conf/options *** sys/conf/options Mon Feb 8 21:05:55 1999 --- sys.new/conf/options Sun Apr 4 14:13:21 1999 *************** *** 68,73 **** --- 68,74 ---- SYSVSHM opt_sysvipc.h UCONSOLE ICMP_BANDLIM + STATIC_ARP_HACK # POSIX kernel options P1003_1B opt_posix.h diff -cr sys/i386/conf/LINT sys.new/i386/conf/LINT *** sys/i386/conf/LINT Mon Mar 29 20:59:38 1999 --- sys.new/i386/conf/LINT Sun Apr 4 14:13:35 1999 *************** *** 482,487 **** --- 482,494 ---- options DUMMYNET options BRIDGE + # STATIC_ARP_HACK enables sending responses to ARP who-has queries + # received on an ethernet interface with ARP disabled (see ifconfig(8) for + # info on -arp parameter). Default is to disable ARP completely on + # such interface. With ARP disabled internal ARP table should be setup + # manually with arp(8) before any routing daemons have been started. + options STATIC_ARP_HACK + # # ATM (HARP version) options # diff -cr sys/netinet/if_ether.c sys.new/netinet/if_ether.c *** sys/netinet/if_ether.c Thu Mar 4 06:04:48 1999 --- sys.new/netinet/if_ether.c Sun Apr 4 14:13:49 1999 *************** *** 42,47 **** --- 42,48 ---- #include "opt_inet.h" #include "opt_bdg.h" + #include "opt_static_arp_hack.h" #include #include *************** *** 285,290 **** --- 286,294 ---- register struct ether_arp *ea; struct sockaddr sa; + if ((ac->ac_if.if_flags & IFF_NOARP) != 0) { + return; + } if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL) return; m->m_len = sizeof(*ea); *************** *** 363,368 **** --- 367,376 ---- bcopy(LLADDR(sdl), desten, sdl->sdl_alen); return 1; } + if ((ac->ac_if.if_flags & IFF_NOARP) != 0) { + m_freem(m); + return (0); + } /* * There is an arptab entry, but no ethernet address * response yet. Replace the held mbuf with this *************** *** 408,413 **** --- 416,424 ---- if (m == 0 || (m->m_flags & M_PKTHDR) == 0) panic("arpintr"); if (m->m_len >= sizeof(struct arphdr) && + #ifndef STATIC_ARP_HACK + (m->m_pkthdr.rcvif->if_flags & IFF_NOARP) == 0 && + #endif (ar = mtod(m, struct arphdr *)) && ntohs(ar->ar_hrd) == ARPHRD_ETHER && m->m_len >= *************** *** 503,508 **** --- 514,524 ---- itaddr = myaddr; goto reply; } + #ifdef STATIC_ARP_HACK + if ((ac->ac_if.if_flags & IFF_NOARP) != 0) { + goto reply; + } + #endif la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0); if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) { #ifndef BRIDGE /* the following is not an error when doing bridging */ --EVF5PPMfhYS0aIcm-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message