On 02/12/15(Wed) 19:48, Claudio Jeker wrote: > More rt_ifp killing. This time in in_arpinput(). > This function is a bit special because of the way we propagte multicast > and broadcast packets it is possible that multiple interfaces recieve the > same request. In most cases this is because of -- you can guess -- > carp(4). So simplify these checks and make them more generic at the same > time (in the SINPROXY case). In other words only the interface holding the > proxy arp route will answer to the requests. > > OK?
ok mpi@ > -- > :wq Claudio > > Index: if_ether.c > =================================================================== > RCS file: /cvs/src/sys/netinet/if_ether.c,v > retrieving revision 1.195 > diff -u -p -r1.195 if_ether.c > --- if_ether.c 2 Dec 2015 18:38:19 -0000 1.195 > +++ if_ether.c 2 Dec 2015 18:42:36 -0000 > @@ -560,7 +560,7 @@ in_arpinput(struct mbuf *m) > ether_sprintf(ea->arp_sha), > ifp->if_xname); > goto out; > - } else if (rt->rt_ifp != ifp) { > + } else if (rt->rt_ifidx != ifp->if_index) { > #if NCARP > 0 > if (ifp->if_type != IFT_CARP) > #endif > @@ -639,10 +639,9 @@ out: > rt = arplookup(itaddr.s_addr, 0, SIN_PROXY, rdomain); > if (rt == NULL) > goto out; > -#if NCARP > 0 > - if (rt->rt_ifp->if_type == IFT_CARP && ifp->if_type != IFT_CARP) > + /* protect from possible duplicates only owner should respond */ > + if (rt->rt_ifidx != ifp->if_index) > goto out; > -#endif > memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha)); > sdl = satosdl(rt->rt_gateway); > memcpy(ea->arp_sha, LLADDR(sdl), sizeof(ea->arp_sha)); >