Page MenuHomeFreeBSD

netinet6: Fix check for pktinfo outgoing ifindex in route cache
ClosedPublic

Authored by pouria on Jul 29 2026, 7:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 21, 2:51 AM
Unknown Object (File)
Wed, Sep 16, 7:03 PM
Unknown Object (File)
Wed, Sep 16, 7:01 PM
Unknown Object (File)
Tue, Sep 15, 11:41 AM
Unknown Object (File)
Mon, Sep 14, 2:13 AM
Unknown Object (File)
Sun, Sep 13, 12:38 PM
Unknown Object (File)
Wed, Sep 9, 9:18 PM
Unknown Object (File)
Sun, Sep 6, 1:47 PM
Subscribers

Details

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 Not Applicable
Unit
Tests Not Applicable