]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Fix condition for nd6_llinfo_getholdsrc() introduced in r287484.
authormelifaro <melifaro@FreeBSD.org>
Sun, 4 Oct 2015 07:02:17 +0000 (07:02 +0000)
committermelifaro <melifaro@FreeBSD.org>
Sun, 4 Oct 2015 07:02:17 +0000 (07:02 +0000)
  Effectively it always returned NULL so SAS was always performed and
  sometimes the result might have been different.

Fix state machine change accidentally introduced in r287985:
  state (4) inside nd6_cache_lladdr() (existing entry got nd message
  with the same lladdress) started to cause lle state transition to STALE
  instead of no-action.

sys/netinet6/nd6.c

index be227904edda6b0706c30d90149812956d2c89fc..7d7f23c51d1fefd3c2b688106c57d1f45daa3b1e 100644 (file)
@@ -530,7 +530,7 @@ nd6_llinfo_get_holdsrc(struct llentry *ln, struct in6_addr *src)
         * assume every packet in la_hold has the same IP header
         */
        m = ln->la_hold;
-       if (sizeof(hdr) < m->m_len)
+       if (sizeof(hdr) > m->m_len)
                return (NULL);
 
        m_copydata(m, 0, sizeof(hdr), (caddr_t)&hdr);
@@ -1798,7 +1798,8 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
                 */
                bcopy(lladdr, &ln->ll_addr, ifp->if_addrlen);
                ln->la_flags |= LLE_VALID;
-               nd6_llinfo_setstate(ln, ND6_LLINFO_STALE);
+               if (do_update != 0)     /* 3,5,7 */
+                       nd6_llinfo_setstate(ln, ND6_LLINFO_STALE);
 
                EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED);