On Mon, Aug 17, 2015 at 12:31:20PM +0200, Martin Pieuchot wrote: > This brings arplookup() in sync with nd6_lookup() and is necessary for > upcoming "struct rtentry" reference count.
> @@ -633,9 +633,10 @@ in_arpinput(struct mbuf *m) > itaddr = myaddr; > goto reply; > } > - la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0, > + rt = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0, > rtable_l2(m->m_pkthdr.ph_rtableid)); > - if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) { > + if (rt != NULL && (la = (struct llinfo_arp *)rt->rt_llinfo) && > + (sdl = SDL(rt->rt_gateway))) { I think the la != NULL check in this if condition is not neccessary as (rt->rt_flags & RTF_LLINFO) has been checked in arplookup(). > @@ -818,7 +818,7 @@ arplookup(u_int32_t addr, int create, in > } > return (0); > } > - return ((struct llinfo_arp *)rt->rt_llinfo); > + return (rt); > } Could you convert the two return (0) in arplookup() into return (NULL)? Anyway OK bluhm@