Page MenuHomeFreeBSD

Fix hostname to be returned in an ICMPv6 NI Reply message
ClosedPublic

Authored by hrs on May 9 2019, 12:19 AM.
Tags
None
Referenced Files
F163086785: D20207.id.diff
Sun, Jul 19, 11:19 PM
Unknown Object (File)
Sat, Jul 18, 4:18 PM
Unknown Object (File)
Sat, Jul 11, 10:15 AM
Unknown Object (File)
Sun, Jul 5, 5:43 AM
Unknown Object (File)
Tue, Jun 30, 5:05 AM
Unknown Object (File)
May 8 2026, 1:41 PM
Unknown Object (File)
May 8 2026, 1:41 PM
Unknown Object (File)
May 8 2026, 1:40 PM
Subscribers

Details

Summary

Fix hostname to be returned in an ICMPv6 NI Reply message defined in RFC 4620, ICMPv6 Node Information Queries. A vnet jail with an IPv6 address sent a hostname of the host environment, not the jail, even if another hostname was set to the jail.

This patch looks for a struct prison for the jail from the allprison list every time when an NI Query message arrives on an interface by using the ifp->if_vnet. Any suggestions of a more efficient way are welcome.

Note that this patch includes a change to narrow a pr->pr_mtx lock. It is not related to the fix above while there is no functionality change.

Test Plan

host# ifconfig epair0 create
host# jail -c -n j1 vnet host.hostname=vnetjail path=/ persist
host# ifconfig epair0b vnet j1
host# ifconfig epair0a inet6 -ifdisabled auto_linklocal up
host# jexec j1 ifconfig epair0b inet6 -ifdisabled auto_linklocal up
host# ping6 -w ff02::1%epair0a

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable