Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 May 2011 12:05:42 -0400
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        "Li, Qing" <qing.li@bluecoat.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, Ingo Flaschberger <if@xip.at>
Subject:   Re: interface ip arp
Message-ID:  <BANLkTimiVmGKBa728vWjghuNgX15DpO-kg@mail.gmail.com>
In-Reply-To: <B143A8975061C446AD5E29742C53172304AFD2@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> <B143A8975061C446AD5E29742C53172304AFD2@PWSVL-EXCMBX-01.internal.cacheflow.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Mon, May 2, 2011 at 4:03 AM, Li, Qing <qing.li@bluecoat.com> wrote:
> Please give this patch a try for IPv4 ARP
>
> http://people.freebsd.org/~qingli/arp2.patch
>
Your patch works; the manually added address is kept upon a up/down/up
transition. However, the interface address is still flush, which I
find inconsistent with it being marked 'permanent'.

 - Arnaud

> --Qing
>
> ________________________________________
> From: owner-freebsd-net@freebsd.org [owner-freebsd-net@freebsd.org] on be=
half of Li, Qing
> Sent: Monday, May 02, 2011 12:45 AM
> To: Arnaud Lacombe
> Cc: freebsd-net@freebsd.org; Ingo Flaschberger
> Subject: RE: interface ip arp
>
> Your patch doesn't work because the in_lltable_prefix_free() is =A0a gene=
ric function.
>
> The static entries are kept only when issuing if-down command, however, i=
f the interface
> address is being removed, permanent static entries are gone and have to b=
e reinstalled.
>
> I already have a working patch for IPv4, just going over the IPv6 code.
>
> I will post the patch in a few minutes.
>
> -- Qing
>
> ________________________________________
> From: Arnaud Lacombe [lacombar@gmail.com]
> Sent: Monday, May 02, 2011 12:41 AM
> To: Li, Qing
> Cc: Ingo Flaschberger; freebsd-net@freebsd.org
> Subject: Re: interface ip arp
>
> Hi,
>
> On Sun, May 1, 2011 at 10:50 PM, Li, Qing <qing.li@bluecoat.com> 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,
>
> =A0 =A0 =A0 =A0for (i=3D0; i < LLTBL_HASHTBL_SIZE; i++) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LIST_FOREACH_SAFE(lle, &llt->lle_head[i], =
lle_next, next) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (lle->la_flags & LLE_STA=
TIC)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (IN_ARE_MASKED_ADDR_EQU=
AL((struct
> sockaddr_in *)L3_ADDR(lle),
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 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,
> =A0- Arnaud
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>



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