inet6: Set rtentry properly in nd6_output()
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 15 Aug 2015 12:34:39 +0000 (20:34 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 15 Aug 2015 12:34:39 +0000 (20:34 +0800)
sys/netinet6/nd6.c

index 71acc89..6a6abbd 100644 (file)
@@ -1854,7 +1854,7 @@ nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m,
                goto sendpkt;
 
        /*
-        * next hop determination.  This routine is derived from ether_outpout.
+        * Next hop determination.  This routine is derived from rt_llroute.
         */
        if (rt != NULL) {
                if (!(rt->rt_flags & RTF_UP)) {
@@ -1902,6 +1902,7 @@ nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m,
                                if (rt->rt_gwroute == NULL)
                                        gotoerr(EHOSTUNREACH);
                        }
+                       rt = rt->rt_gwroute;
                }
        }