Page MenuHomeFreeBSD

Rpcbind: skip ipv6 link local if a request doesn't come from link local address

Authored by on Aug 10 2021, 3:06 PM.
Referenced Files
Unknown Object (File)
Sat, Feb 4, 2:50 AM
Unknown Object (File)
Thu, Jan 12, 3:19 AM
Unknown Object (File)
Jan 8 2023, 5:24 AM
Unknown Object (File)
Jan 4 2023, 2:31 AM
Unknown Object (File)
Dec 25 2022, 9:59 PM
Unknown Object (File)
Dec 14 2022, 5:53 AM
Unknown Object (File)
Nov 27 2022, 10:35 AM



RPCINFO on macOS behaves different compared to other linux clients and doesn't provide request address in rpcb structure of the RPCBPROC_GETADDRLIST call which doesn't seem to be forbidden.

In this case RPCBIND uses RPC call's source address and picks a closest corresponding local address.
Though if there are no addresses in the same subnet as the source address, return of RPCBIND may vary depending on the order of addresses returned in getifaddrs.
If a link local precedes global address it may be returned even if request comes neither from a link local nor from link local in a different scope, which will prevent services like nfs from working in tpc6 scenario on macOS clients.
Issue can be seen only on FreeBSD rpcbind port due to changes in workflow of addrmerge call.

Test Plan

Test with macOS client over rpcinfo


        inet6 fe80::1c1c:30b:1b4c:76e8%en0 prefixlen 64 secured scopeid 0x5
        inet6 2620::170:7c09:14d4:6177:d182:bb8e prefixlen 64 duplicated autoconf secured
        inet netmask 0xfffffe00 broadcast
        inet6 2620::170:7c09:5df9:1265:d54a:bd87 prefixlen 64 autoconf temporary


vmx1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        inet netmask 0xfffffc00 broadcast zone 1
        inet6 fe80::250:56ff:fe8b:67ca%vmx1 prefixlen 64 scopeid 0x2 zone 1
        inet6 2620:0:170:9947:0:beef:7e4:8600 prefixlen 64 zone 1

Prior fix:

osx1014-template:~ protocols$ rpcinfo -l -T tcp6 2620:0:170:9947:0:beef:7e4:8600  100003 3
   program vers  tp_family/name/class     address                         service
    100003  3    inet6/tcp/cots_ord       fe80::250:56ff:fe8b:67ca.8.1      nfs
    100003  3    inet6/udp/clts           fe80::250:56ff:fe8b:67ca.8.1      nfs

After fix:

osx1014-template:~ protocols$ rpcinfo -l -T tcp6 2620:0:170:9947:0:beef:7e4:8600  100003 3
   program vers  tp_family/name/class     address                         service
    100003  3    inet6/tcp/cots_ord       2620:0:170:9947:0:beef:7e4:8600.8.1  nfs
    100003  3    inet6/udp/clts           2620:0:170:9947:0:beef:7e4:8600.8.1  nfs

Rpcbind kyua tests

addrmerge_test:addrmerge_bindip  ->  passed  [0.014s]
addrmerge_test:addrmerge_bindip6  ->  passed  [0.014s]
addrmerge_test:addrmerge_bindip6_rev  ->  passed  [0.012s]
addrmerge_test:addrmerge_bindip_rev  ->  passed  [0.012s]
addrmerge_test:addrmerge_ipv6_linklocal  ->  passed  [0.012s]
addrmerge_test:addrmerge_ipv6_linklocal_rev  ->  passed  [0.012s]
addrmerge_test:addrmerge_ipv6_other_subnet  ->  passed  [0.012s]
addrmerge_test:addrmerge_localhost_only  ->  passed  [0.013s]
addrmerge_test:addrmerge_localhost_only6  ->  passed  [0.013s]
addrmerge_test:addrmerge_noifaddrs  ->  passed  [0.012s]
addrmerge_test:addrmerge_one_addr_on_each_subnet  ->  passed  [0.012s]
addrmerge_test:addrmerge_one_addr_on_each_subnet6  ->  passed  [0.012s]
addrmerge_test:addrmerge_one_addr_on_each_subnet6_rev  ->  passed  [0.012s]
addrmerge_test:addrmerge_one_addr_on_each_subnet_rev  ->  passed  [0.013s]
addrmerge_test:addrmerge_point2point  ->  passed  [0.013s]
addrmerge_test:addrmerge_point2point6  ->  passed  [0.013s]
addrmerge_test:addrmerge_point2point6_rev  ->  passed  [0.011s]
addrmerge_test:addrmerge_point2point_rev  ->  passed  [0.011s]
addrmerge_test:addrmerge_recvdstaddr  ->  passed  [0.011s]
addrmerge_test:addrmerge_recvdstaddr6  ->  passed  [0.011s]
addrmerge_test:addrmerge_recvdstaddr6_rev  ->  passed  [0.011s]
addrmerge_test:addrmerge_recvdstaddr_rev  ->  passed  [0.011s]
addrmerge_test:addrmerge_singlehomed  ->  passed  [0.009s]
addrmerge_test:addrmerge_singlehomed6  ->  passed  [0.010s]

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable