diff --git a/sys/net/route.h b/sys/net/route.h index 8313c5a..7890eb1 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -145,14 +145,14 @@ struct ortentry { #define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ #define RTF_DONE 0x40 /* message confirmed */ #define RTF_MASK 0x80 /* subnet mask present */ -/* #define RTF_CLONING 0x100 generate new routes on use */ +// #define RTF_CLONING 0x100 /* generate new routes on use */ #define RTF_CONNECTED 0x100 /* hosts on this route are neighbours */ -/* #define RTF_XRESOLVE 0x200 external daemon resolves name */ -/* #define RTF_LLINFO 0x400 generated by ARP or NDP */ +// #define RTF_XRESOLVE 0x200 /* external daemon resolves name */ +// #define RTF_LLINFO 0x400 /* generated by ARP or NDP */ #define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */ #define RTF_STATIC 0x800 /* manually added */ #define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ -/* #define RTF_CLONED 0x2000 this is a cloned route */ +// #define RTF_CLONED 0x2000 /* this is a cloned route */ #define RTF_PROTO2 0x4000 /* protocol specific routing flag */ #define RTF_PROTO1 0x8000 /* protocol specific routing flag */ #define RTF_SRC 0x10000 /* route has fixed source address */ @@ -218,7 +218,7 @@ struct rt_msghdr { #define RTM_LOCK 0x8 /* fix specified metrics */ #define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ #define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ -/* #define RTM_RESOLVE 0xb req to resolve dst to LL addr */ +// #define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ #define RTM_NEWADDR 0xc /* address being added to iface */ #define RTM_DELADDR 0xd /* address being removed from iface */ #define RTM_OOIFINFO 0xe /* Old (pre-1.5) RTM_IFINFO message */ diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index bc22d12..465f1aa 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1070,12 +1070,18 @@ nd6_is_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp) return 1; /* - * Even if the address matches none of our addresses, it might match - * a cloning route or be in the neighbor cache. + * Even if the address matches none of our addresses, it might be + * in the neighbor cache or a connected route. */ + ln = nd6_lookup(&addr->sin6_addr, ifp, false); + if (ln != NULL) { + LLE_RUNLOCK(ln); + return 1; + } + rt = rtalloc1(sin6tocsa(addr), 0); if (rt == NULL) - goto neighbor; + return 0; if ((rt->rt_flags & RTF_CONNECTED) && (rt->rt_ifp == ifp #if NBRIDGE > 0 @@ -1092,12 +1098,6 @@ nd6_is_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp) return 1; } rtfree(rt); -neighbor: - ln = nd6_lookup(&addr->sin6_addr, ifp, false); - if (ln != NULL) { - LLE_RUNLOCK(ln); - return 1; - } return 0; }