Module Name:    src
Committed By:   ozaki-r
Date:           Mon Mar 31 05:55:43 UTC 2025

Modified Files:
        src/sys/netinet6: nd6.c

Log Message:
nd6: send packets through the fast path even if DELAY and PROBE

If there is a valid ND cache, we can send packets for the destination
of the cache.  If the state of the cache is STALE, we need to go
through the slow path to change its state.  In the other cases
including the DELAY and PROBE states, we can send packets through
the fast path.


To generate a diff of this commit:
cvs rdiff -u -r1.282 -r1.283 src/sys/netinet6/nd6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.282 src/sys/netinet6/nd6.c:1.283
--- src/sys/netinet6/nd6.c:1.282	Thu Apr 11 07:34:37 2024
+++ src/sys/netinet6/nd6.c	Mon Mar 31 05:55:43 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.282 2024/04/11 07:34:37 knakahara Exp $	*/
+/*	$NetBSD: nd6.c,v 1.283 2025/03/31 05:55:43 ozaki-r Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.282 2024/04/11 07:34:37 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.283 2025/03/31 05:55:43 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1596,7 +1596,10 @@ nd6_resolve(struct ifnet *ifp, const str
 	ln = nd6_lookup(&dst->sin6_addr, ifp, false);
 
 	if (ln != NULL && (ln->la_flags & LLE_VALID) != 0 &&
-	    ln->ln_state == ND_LLINFO_REACHABLE) {
+	    /* Only STALE needs to go the slow path to change its state. */
+	    (ln->ln_state == ND_LLINFO_REACHABLE ||
+	     ln->ln_state == ND_LLINFO_DELAY ||
+	     ln->ln_state == ND_LLINFO_PROBE)) {
 		/* Fast path */
 		memcpy(lldst, &ln->ll_addr, MIN(dstsize, ifp->if_addrlen));
 		LLE_RUNLOCK(ln);

Reply via email to