On Mon, Jul 10, 2017 at 04:55:53PM +0200, Alexander Bluhm wrote:
> 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
There is anecdotal evidence that it worked. slaacd does not implement
it yet.
I'm hoping that other people show up with diffs for missing
functionality :) Stranger things have happened...
> 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.
Bah, I should not only have worked towards diffability between
nd6_rs_input and nd6_ra_input, I should have actually diffed the two
functions :(
Thanks for spotting this stupid mistake!
>
> with that fixed, OK bluhm@
>
For the record, this is the diff on top of the previous one, not
going to resend it...
diff --git nd6_rtr.c nd6_rtr.c
index 3140cfb23ea..5c477ec3ea7 100644
--- nd6_rtr.c
+++ nd6_rtr.c
@@ -177,11 +177,11 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len)
/* Sanity checks */
if (ip6->ip6_hlim != 255) {
nd6log((LOG_ERR,
- "nd6_ra_input: invalid hlim (%d) from %s to %s on %s\n",
+ "nd6_ra_input: invalid hlim (%d) from %s to %s on %u\n",
ip6->ip6_hlim,
inet_ntop(AF_INET6, &ip6->ip6_src, src, sizeof(src)),
inet_ntop(AF_INET6, &ip6->ip6_dst, dst, sizeof(dst)),
- ifp->if_xname));
+ m->m_pkthdr.ph_ifidx));
goto bad;
}
--
I'm not entirely sure you are real.