On Mon, Jul 10, 2017 at 08:04:26AM +0000, Florian Obser wrote:
> I think it's time...

Great, no default router, no prefix list!

Does slaacd support on-link detection?  I don't know if it worked
before, it could be implemented later, and I don't mind if we loose
it.  Just asking out of curiosity.

> @@ -370,32 +166,15 @@ void
>  nd6_ra_input(struct mbuf *m, int off, int icmp6len)
>  {
>       struct ifnet *ifp;
> -     struct nd_ifinfo *ndi;
>       struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
>       struct nd_router_advert *nd_ra;
>       struct in6_addr saddr6 = ip6->ip6_src;
> +     char *lladdr = NULL;
> +     int lladdrlen = 0;
>       union nd_opts ndopts;
> -     struct nd_defrouter *dr;
>       char src[INET6_ADDRSTRLEN], dst[INET6_ADDRSTRLEN];
>  
> -     ifp = if_get(m->m_pkthdr.ph_ifidx);
> -     if (ifp == NULL)
> -             goto freeit;
> -
> -     goto freeit;
> -
> -     /* We accept RAs only if inet6 autoconf is enabled  */
> -     if (!(ifp->if_xflags & IFXF_AUTOCONF6))
> -             goto freeit;
> -
> -     ndi = ND_IFINFO(ifp);
> -     if (!(ndi->flags & ND6_IFF_ACCEPT_RTADV))
> -             goto freeit;
> -
> -     if (nd6_rs_output_timeout != ND6_RS_OUTPUT_INTERVAL)
> -             /* we saw a RA, stop quick timer */
> -             nd6_rs_output_set_timo(ND6_RS_OUTPUT_INTERVAL);
> -
> +     /* Sanity checks */
>       if (ip6->ip6_hlim != 255) {
>               nd6log((LOG_ERR,
>                   "nd6_ra_input: invalid hlim (%d) from %s to %s on %s\n",
> @@ -416,7 +195,6 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len)
>       IP6_EXTHDR_GET(nd_ra, struct nd_router_advert *, m, off, icmp6len);
>       if (nd_ra == NULL) {
>               icmp6stat_inc(icp6s_tooshort);
> -             if_put(ifp);
>               return;
>       }
>  

Between these chunks there is still a reference to ifp->if_xname
in a nd6log() message.  ifp is uninitialized now.

with that fixed, OK bluhm@

Reply via email to