git: 7753a59fdf19 - main - netinet6: Fix check for pktinfo outgoing ifindex in route cache

From: Pouria Mousavizadeh Tehrani <pouria_at_FreeBSD.org>
Date: Fri, 14 Aug 2026 20:25:54 UTC
The branch main has been updated by pouria:

URL: https://cgit.FreeBSD.org/src/commit/?id=7753a59fdf196fcbd8bb5706ad44bfc590bce0a9

commit 7753a59fdf196fcbd8bb5706ad44bfc590bce0a9
Author:     Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
AuthorDate: 2026-07-29 19:32:35 +0000
Commit:     Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
CommitDate: 2026-08-14 20:22:26 +0000

    netinet6: Fix check for pktinfo outgoing ifindex in route cache
    
    lookup_route is only called for outgoing traffic, therefore
    check nh_ifp index instead of nh_aifp as specified by RFC3542 sec 6.
    
    Differential Revision: https://reviews.freebsd.org/D58544
---
 sys/netinet6/in6_src.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 07e5b191afc2..1923908873f8 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -696,7 +696,7 @@ lookup_route(uint32_t fibnum, struct sockaddr_in6 *dst, struct route_in6 *ro,
 		 */
 		struct in6_pktinfo *pi;
 		if (opts && (pi = opts->ip6po_pktinfo) != NULL && pi->ipi6_ifindex) {
-			if (nh->nh_aifp->if_index != pi->ipi6_ifindex)
+			if (nh->nh_ifp->if_index != pi->ipi6_ifindex)
 				nh = NULL;
 		}
 	}