A single cast-free struct pointer dereference needs no indirection. ND_IFINFO() is under _KERNEL.
OK? diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 1924c36c813..d6ccfd3a272 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -367,7 +367,7 @@ nd6_llinfo_timer(struct rtentry *rt) case ND6_LLINFO_INCOMPLETE: if (ln->ln_asked < nd6_mmaxtries) { ln->ln_asked++; - nd6_llinfo_settimer(ln, ND_IFINFO(ifp)->retrans / 1000); + nd6_llinfo_settimer(ln, ifp->if_nd->retrans / 1000); nd6_ns_output(ifp, NULL, &dst->sin6_addr, ln, 0); } else { struct mbuf *m = ln->ln_hold; @@ -414,13 +414,13 @@ nd6_llinfo_timer(struct rtentry *rt) /* We need NUD */ ln->ln_asked = 1; ln->ln_state = ND6_LLINFO_PROBE; - nd6_llinfo_settimer(ln, ND_IFINFO(ifp)->retrans / 1000); + nd6_llinfo_settimer(ln, ifp->if_nd->retrans / 1000); nd6_ns_output(ifp, &dst->sin6_addr, &dst->sin6_addr, ln, 0); break; case ND6_LLINFO_PROBE: if (ln->ln_asked < nd6_umaxtries) { ln->ln_asked++; - nd6_llinfo_settimer(ln, ND_IFINFO(ifp)->retrans / 1000); + nd6_llinfo_settimer(ln, ifp->if_nd->retrans / 1000); nd6_ns_output(ifp, &dst->sin6_addr, &dst->sin6_addr, ln, 0); } else { @@ -766,7 +766,7 @@ nd6_nud_hint(struct rtentry *rt) ln->ln_state = ND6_LLINFO_REACHABLE; if (!ND6_LLINFO_PERMANENT(ln)) - nd6_llinfo_settimer(ln, ND_IFINFO(ifp)->reachable); + nd6_llinfo_settimer(ln, ifp->if_nd->reachable); out: if_put(ifp); } @@ -1014,7 +1014,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) switch (cmd) { case SIOCGIFINFO_IN6: NET_LOCK_SHARED(); - ndi->ndi = *ND_IFINFO(ifp); + ndi->ndi = *ifp->if_nd; NET_UNLOCK_SHARED(); return (0); case SIOCGNBRINFO_IN6: @@ -1295,7 +1295,7 @@ nd6_slowtimo(void *ignored_arg) timeout_add_sec(&nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL); TAILQ_FOREACH(ifp, &ifnetlist, if_list) { - nd6if = ND_IFINFO(ifp); + nd6if = ifp->if_nd; if (nd6if->basereachable && /* already initialized */ (nd6if->recalctm -= ND6_SLOWTIMER_INTERVAL) <= 0) { /* @@ -1414,7 +1414,7 @@ nd6_resolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, */ if (!ND6_LLINFO_PERMANENT(ln) && ln->ln_asked == 0) { ln->ln_asked++; - nd6_llinfo_settimer(ln, ND_IFINFO(ifp)->retrans / 1000); + nd6_llinfo_settimer(ln, ifp->if_nd->retrans / 1000); nd6_ns_output(ifp, NULL, &satosin6(dst)->sin6_addr, ln, 0); } return (EAGAIN); diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 53913e67bab..10eee295322 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -76,9 +76,6 @@ struct in6_ndireq { #include <sys/queue.h> -#define ND_IFINFO(ifp) \ - ((ifp)->if_nd) - struct llinfo_nd6 { TAILQ_ENTRY(llinfo_nd6) ln_list; struct rtentry *ln_rt; diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 3701ae49cf4..5f499e5f3e4 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -716,7 +716,7 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) rtm_send(rt, RTM_RESOLVE, 0, ifp->if_rdomain); if (!ND6_LLINFO_PERMANENT(ln)) { nd6_llinfo_settimer(ln, - ND_IFINFO(ifp)->reachable); + ifp->if_nd->reachable); } } else { ln->ln_state = ND6_LLINFO_STALE; @@ -806,7 +806,7 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) ln->ln_byhint = 0; if (!ND6_LLINFO_PERMANENT(ln)) { nd6_llinfo_settimer(ln, - ND_IFINFO(ifp)->reachable); + ifp->if_nd->reachable); } } else { if (lladdr && llchange) { @@ -1129,7 +1129,7 @@ nd6_dad_start(struct ifaddr *ifa) dp->dad_ns_icount = dp->dad_na_icount = 0; dp->dad_ns_ocount = dp->dad_ns_tcount = 0; nd6_dad_ns_output(dp, ifa); - nd6_dad_starttimer(dp, ND_IFINFO(ifa->ifa_ifp)->retrans); + nd6_dad_starttimer(dp, ifa->ifa_ifp->if_nd->retrans); } /* @@ -1211,7 +1211,7 @@ nd6_dad_timer(void *xifa) * We have more NS to go. Send NS packet for DAD. */ nd6_dad_ns_output(dp, ifa); - nd6_dad_starttimer(dp, ND_IFINFO(ifa->ifa_ifp)->retrans); + nd6_dad_starttimer(dp, ifa->ifa_ifp->if_nd->retrans); } else { /* * We have transmitted sufficient number of DAD packets.