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
This commit is contained in:
Pouria Mousavizadeh Tehrani committed 2026-08-14 23:52:26 +03:30
1 parent 5549785665
commit 7753a59fdf
1 file changed
+1 -1
+1 -1
View File
@@ -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;
}
}