From owner-freebsd-net@FreeBSD.ORG Mon May 2 07:45:27 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 416AD106566B for ; Mon, 2 May 2011 07:45:27 +0000 (UTC) (envelope-from qing.li@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.freebsd.org (Postfix) with ESMTP id 2310E8FC13 for ; Mon, 2 May 2011 07:45:26 +0000 (UTC) Received: from PWSVL-EXCHTS-01.internal.cacheflow.com ([10.2.2.122]) by whisker.bluecoat.com (8.14.2/8.14.2) with ESMTP id p427jQLm027236 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 2 May 2011 00:45:26 -0700 (PDT) Received: from PWSVL-EXCMBX-01.internal.cacheflow.com ([fe80::15bc:12e2:4676:340f]) by PWSVL-EXCHTS-01.internal.cacheflow.com ([fe80::5c50:e2ba:8115:4223%20]) with mapi id 14.01.0255.000; Mon, 2 May 2011 00:45:20 -0700 From: "Li, Qing" To: Arnaud Lacombe Thread-Topic: interface ip arp Thread-Index: AQHMCFqrtGblL2pVN0K+AdsrWd9STpR4pYP8gAAxBUiAAMbUgP//ivAO Date: Mon, 2 May 2011 07:45:20 +0000 Message-ID: References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [216.52.23.68] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-net@freebsd.org" , Ingo Flaschberger Subject: RE: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 07:45:27 -0000 Your patch doesn't work because the in_lltable_prefix_free() is a generic = function. =0A= =0A= The static entries are kept only when issuing if-down command, however, if = the interface =0A= address is being removed, permanent static entries are gone and have to be = reinstalled.=0A= =0A= I already have a working patch for IPv4, just going over the IPv6 code.=0A= =0A= I will post the patch in a few minutes.=0A= =0A= -- Qing=0A= =0A= ________________________________________=0A= From: Arnaud Lacombe [lacombar@gmail.com]=0A= Sent: Monday, May 02, 2011 12:41 AM=0A= To: Li, Qing=0A= Cc: Ingo Flaschberger; freebsd-net@freebsd.org=0A= Subject: Re: interface ip arp=0A= =0A= Hi,=0A= =0A= On Sun, May 1, 2011 at 10:50 PM, Li, Qing wrote:=0A= > jeez, this bug has been around for quite a while ...=0A= >=0A= > Please try patch at http://people.freebsd.org/~qingli/arp.patch=0A= >=0A= d'oh!... Concerning Ingo's bug, your patch do the job, my report was=0A= bad, 4.9-RELEASE and 7.x show the same behavior:=0A= =0A= # uname -a=0A= FreeBSD server 7.1-RELEASE-p13 FreeBSD 7.1-RELEASE-p13=0A= # ifconfig em0 up 192.168.45.200/24=0A= # arp -n 192.168.45.200=0A= ? (192.168.45.200) at 00:03:2d:16:6e:fc on em0 permanent [ethernet]=0A= # ifconfig em0 down=0A= # arp -n 192.168.45.200=0A= 192.168.45.200 (192.168.45.200) -- no entry=0A= # ifconfig em0 up=0A= # arp -n 192.168.45.200=0A= 192.168.45.200 (192.168.45.200) -- no entry=0A= =0A= The behavioral change I noticed is that permanent address (manually=0A= added) in the ARP table are flushed along with all other addresses on=0A= >8.x (cf. the script output of my previous mail) while they are kept=0A= in the cache on <7.x during a down/up transition. The following patch:=0A= =0A= diff --git a/sys/netinet/in.c b/sys/netinet/in.c=0A= index 1012012..27e44a2 100644=0A= --- a/sys/netinet/in.c=0A= +++ b/sys/netinet/in.c=0A= @@ -1372,6 +1372,8 @@ in_lltable_prefix_free(struct lltable *llt,=0A= =0A= for (i=3D0; i < LLTBL_HASHTBL_SIZE; i++) {=0A= LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {= =0A= + if (lle->la_flags & LLE_STATIC)=0A= + continue;=0A= if (IN_ARE_MASKED_ADDR_EQUAL((struct=0A= sockaddr_in *)L3_ADDR(lle),=0A= pfx, msk)) {=0A= =0A= partially restores the old behavior. Only partially as before 8.x,=0A= interface addresses were not marked as 'permanent'. You could manually=0A= add a 'permanent' entry for this address in such a way it would=0A= survive the down/up transition. In 8.x, the interface address is=0A= marked as 'permanent', but is removed explicitly by arp_ifscrub(). So=0A= even the above change would not work for the interface address.=0A= =0A= Shouldn't this address be removed later when "removing all L2 entries=0A= on the given prefix", in which case it would not have to be re-added=0A= again, if marking it 'permanent' is deliberate ?=0A= =0A= Thanks,=0A= - Arnaud=0A=