Page MenuHomeFreeBSD

netinet6: Fix check for pktinfo outgoing ifindex in route cache
Needs ReviewPublic

Authored by pouria on Wed, Jul 29, 7:39 PM.

Details

Reviewers
glebius
markj
melifaro
Group Reviewers
network
Summary

lookup_route is only called for outgoing traffic, therefore
check nh_ifp index instead of nh_aifp as specified by RFC3542 sec 6.

Test Plan

Set your interface index on this test code:
https://people.freebsd.org/~pouria/ipv6_pktinfo_tcp_ifi.c

With wrong index:

[pouria@cornelia] [~/code/c] % ./ipv6_pktinfo_tcp_ifi
connect: No route to host

With right one:

[pouria@cornelia] [~/code/c] % cc -o ipv6_pktinfo_tcp_ifi ipv6_pktinfo_tcp_ifi.c
[pouria@cornelia] [~/code/c] % ./ipv6_pktinfo_tcp_ifi
Connected successfully!
Sent GET request
Recv GET response
HTTP/1.1 200 OK
Date: Fri, 31 Jul 2026 19:20:38 GMT
Content-Type: text/plain
Content-Length: 36
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
...

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75279
Build 72162: arc lint + arc unit