From owner-freebsd-net@FreeBSD.ORG Mon May 2 07:41:36 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 980281065670 for ; Mon, 2 May 2011 07:41:36 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5D22E8FC1B for ; Mon, 2 May 2011 07:41:36 +0000 (UTC) Received: by iyj12 with SMTP id 12so6314747iyj.13 for ; Mon, 02 May 2011 00:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=U/kAESPXehPewGb7oPCXZVjwM99zZBkxO+5RzTxeKAY=; b=D3Btq+NjgvBmEU1vjl8x4jKwy0fUr7lIsY6z98YEAaIiGVqNLHC/kKKhwBhD/uIge/ hZYVwIUgtI9MOQHE/3a/cFdGuHvEzqKeH/7MhPMCja9OIDBTVKVIs/cOcfrGvad+mtHP p6Fgt2OqYn8j5bqJrQ7R4dCkwLmVaU7grpfcA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=KOJHT44oMnbAyTlxjzkLFfvGFijclJ+kc1GUsBdPsFrzzr/RWIvivgfTJXvKi3eAd8 rOYm5LcZYduPRtjKW3PAZF8hX/3fVhg2XztE08sBE9bA1J0SMwYBVx1gNa1QCpDRdjY8 4s47piZs7AizI4ZBUI4lRd0N3Dk/b6HekZvV4= MIME-Version: 1.0 Received: by 10.42.150.8 with SMTP id y8mr10013217icv.471.1304322095704; Mon, 02 May 2011 00:41:35 -0700 (PDT) Received: by 10.42.165.132 with HTTP; Mon, 2 May 2011 00:41:35 -0700 (PDT) In-Reply-To: References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> Date: Mon, 2 May 2011 03:41:35 -0400 Message-ID: From: Arnaud Lacombe To: "Li, Qing" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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:41:36 -0000 Hi, On Sun, May 1, 2011 at 10:50 PM, Li, Qing wrote: > jeez, this bug has been around for quite a while ... > > Please try patch at =A0http://people.freebsd.org/~qingli/arp.patch > d'oh!... Concerning Ingo's bug, your patch do the job, my report was bad, 4.9-RELEASE and 7.x show the same behavior: # uname -a FreeBSD server 7.1-RELEASE-p13 FreeBSD 7.1-RELEASE-p13 # ifconfig em0 up 192.168.45.200/24 # arp -n 192.168.45.200 ? (192.168.45.200) at 00:03:2d:16:6e:fc on em0 permanent [ethernet] # ifconfig em0 down # arp -n 192.168.45.200 192.168.45.200 (192.168.45.200) -- no entry # ifconfig em0 up # arp -n 192.168.45.200 192.168.45.200 (192.168.45.200) -- no entry The behavioral change I noticed is that permanent address (manually added) in the ARP table are flushed along with all other addresses on >8.x (cf. the script output of my previous mail) while they are kept in the cache on <7.x during a down/up transition. The following patch: diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 1012012..27e44a2 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1372,6 +1372,8 @@ in_lltable_prefix_free(struct lltable *llt, for (i=3D0; i < LLTBL_HASHTBL_SIZE; i++) { LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) { + if (lle->la_flags & LLE_STATIC) + continue; if (IN_ARE_MASKED_ADDR_EQUAL((struct sockaddr_in *)L3_ADDR(lle), pfx, msk)) { partially restores the old behavior. Only partially as before 8.x, interface addresses were not marked as 'permanent'. You could manually add a 'permanent' entry for this address in such a way it would survive the down/up transition. In 8.x, the interface address is marked as 'permanent', but is removed explicitly by arp_ifscrub(). So even the above change would not work for the interface address. Shouldn't this address be removed later when "removing all L2 entries on the given prefix", in which case it would not have to be re-added again, if marking it 'permanent' is deliberate ? Thanks, - Arnaud