Module Name:    src
Committed By:   roy
Date:           Sat Oct  5 09:10:53 UTC 2024

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

Log Message:
ND6: only ignore messages from the receving interface

Sync with ARP behaviour, reverts r1.163 slightly.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/netinet6/nd6_nbr.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_nbr.c
diff -u src/sys/netinet6/nd6_nbr.c:1.183 src/sys/netinet6/nd6_nbr.c:1.184
--- src/sys/netinet6/nd6_nbr.c:1.183	Wed Mar 29 13:01:44 2023
+++ src/sys/netinet6/nd6_nbr.c	Sat Oct  5 09:10:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_nbr.c,v 1.183 2023/03/29 13:01:44 kardel Exp $	*/
+/*	$NetBSD: nd6_nbr.c,v 1.184 2024/10/05 09:10:53 roy Exp $	*/
 /*	$KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.183 2023/03/29 13:01:44 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.184 2024/10/05 09:10:53 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -677,23 +677,21 @@ nd6_na_input(struct mbuf *m, int off, in
 	}
 
 	if (ndopts.nd_opts_tgt_lladdr != NULL) {
-		struct ifnet *ifp_ll;
-		struct psref psref_ll;
-
 		lladdr = (char *)(ndopts.nd_opts_tgt_lladdr + 1);
 		lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3;
+	}
 
-		if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) {
+	if (lladdr != NULL) {
+		if (((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) {
 			nd6log(LOG_INFO, "lladdrlen mismatch for %s "
-			    "(if %d, NA packet %d)\n", IN6_PRINT(ip6buf, &taddr6),
+			    "(if %d, NA packet %d)\n",
+			    IN6_PRINT(ip6buf, &taddr6),
 			    ifp->if_addrlen, lladdrlen - 2);
 			goto bad;
 		}
 
-		ifp_ll = if_get_bylla(lladdr, ifp->if_addrlen, &psref_ll);
-		if (ifp_ll != NULL) {
+		if (!memcmp(lladdr, CLLADDR(ifp->if_sadl), ifp->if_addrlen)) {
 			/* it's from me, ignore it. */
-			if_put(ifp_ll, &psref_ll);
 			goto freeit;
 		}
 	}

Reply via email to