summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2015-10-04 07:02:17 +0000
committermelifaro <melifaro@FreeBSD.org>2015-10-04 07:02:17 +0000
commit15bc65f144a8e7501d5b41594aa7436b28858d6f (patch)
tree2ad896b64a9200419a59c7a00e79ef81c6e433ff /sys/netinet6
parentb30c9f839ead5c7ffeaf62cabca97b6d2ba948c8 (diff)
downloadFreeBSD-src-15bc65f144a8e7501d5b41594aa7436b28858d6f.zip
FreeBSD-src-15bc65f144a8e7501d5b41594aa7436b28858d6f.tar.gz
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.
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/nd6.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index be22790..7d7f23c 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -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);
OpenPOWER on IntegriCloud