Author: melifaro
Date: Sun Oct  4 07:02:17 2015
New Revision: 288652
URL: https://svnweb.freebsd.org/changeset/base/288652

Log:
  Fix condition for nd6_llinfo_getholdsrc() introduced in r287484.
    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.

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c     Sun Oct  4 06:31:30 2015        (r288651)
+++ head/sys/netinet6/nd6.c     Sun Oct  4 07:02:17 2015        (r288652)
@@ -530,7 +530,7 @@ nd6_llinfo_get_holdsrc(struct llentry *l
         * 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, stru
                 */
                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);
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to