Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 May 2011 08:03:57 +0000
From:      "Li, Qing" <qing.li@bluecoat.com>
To:        Arnaud Lacombe <lacombar@gmail.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, Ingo Flaschberger <if@xip.at>
Subject:   RE: interface ip arp
Message-ID:  <B143A8975061C446AD5E29742C53172304AFD2@PWSVL-EXCMBX-01.internal.cacheflow.com>
In-Reply-To: <B143A8975061C446AD5E29742C53172304AF79@PWSVL-EXCMBX-01.internal.cacheflow.com>
References:  <alpine.LRH.2.00.1104140140240.8693@filebunker.xip.at> <alpine.LRH.2.00.1105020149570.27379@filebunker.xip.at> <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> <B143A8975061C446AD5E29742C53172304AC91@PWSVL-EXCMBX-01.internal.cacheflow.com>, <BANLkTi=Jcy0QA6smaa=k_JZkJdPLAqf=zg@mail.gmail.com>, <B143A8975061C446AD5E29742C53172304AF79@PWSVL-EXCMBX-01.internal.cacheflow.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Please give this patch a try for IPv4 ARP=0A=
=0A=
http://people.freebsd.org/~qingli/arp2.patch=0A=
=0A=
--Qing=0A=
=0A=
________________________________________=0A=
From: owner-freebsd-net@freebsd.org [owner-freebsd-net@freebsd.org] on beha=
lf of Li, Qing=0A=
Sent: Monday, May 02, 2011 12:45 AM=0A=
To: Arnaud Lacombe=0A=
Cc: freebsd-net@freebsd.org; Ingo Flaschberger=0A=
Subject: RE: interface ip arp=0A=
=0A=
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 <qing.li@bluecoat.com> 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=
_______________________________________________=0A=
freebsd-net@freebsd.org mailing list=0A=
http://lists.freebsd.org/mailman/listinfo/freebsd-net=0A=
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"=0A=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B143A8975061C446AD5E29742C53172304AFD2>