Proxy ARP and published entry

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Proxy ARP and published entry

Martin Pieuchot
When the caller of arplookup() asked for a proxy'd ARP entry, make
sure the entry returned by rtalloc(9) is indeed "published".

This is currently always true for ARP entries added with arp(8) but
it is not the case if you add your own entry with the 33rd bit set
but without setting RTF_ANNOUNCE.

It is also not the case with ART.

Since the 33rd bit trick is an implementation detail of the current
routing table, which I'm doing differently with ART, let's check for
the correct flag.

ok?

Index: netinet/if_ether.c
===================================================================
RCS file: /cvs/src/sys/netinet/if_ether.c,v
retrieving revision 1.202
diff -u -p -r1.202 if_ether.c
--- netinet/if_ether.c 7 Mar 2016 11:00:36 -0000 1.202
+++ netinet/if_ether.c 21 Mar 2016 13:22:33 -0000
@@ -696,6 +696,12 @@ arplookup(u_int32_t addr, int create, in
  rtfree(rt);
  return (NULL);
  }
+
+ if (proxy && !ISSET(rt->rt_flags, RTF_ANNOUNCE)) {
+ rtfree(rt);
+ return (NULL);
+ }
+
  return (rt);
 }
 

Reply | Threaded
Open this post in threaded view
|

Re: Proxy ARP and published entry

Alexander Bluhm
On Mon, Mar 21, 2016 at 02:29:46PM +0100, Martin Pieuchot wrote:

> When the caller of arplookup() asked for a proxy'd ARP entry, make
> sure the entry returned by rtalloc(9) is indeed "published".
>
> This is currently always true for ARP entries added with arp(8) but
> it is not the case if you add your own entry with the 33rd bit set
> but without setting RTF_ANNOUNCE.
>
> It is also not the case with ART.
>
> Since the 33rd bit trick is an implementation detail of the current
> routing table, which I'm doing differently with ART, let's check for
> the correct flag.
>
> ok?

OK bluhm@

>
> Index: netinet/if_ether.c
> ===================================================================
> RCS file: /cvs/src/sys/netinet/if_ether.c,v
> retrieving revision 1.202
> diff -u -p -r1.202 if_ether.c
> --- netinet/if_ether.c 7 Mar 2016 11:00:36 -0000 1.202
> +++ netinet/if_ether.c 21 Mar 2016 13:22:33 -0000
> @@ -696,6 +696,12 @@ arplookup(u_int32_t addr, int create, in
>   rtfree(rt);
>   return (NULL);
>   }
> +
> + if (proxy && !ISSET(rt->rt_flags, RTF_ANNOUNCE)) {
> + rtfree(rt);
> + return (NULL);
> + }
> +
>   return (rt);
>  }
>