Page MenuHomeFreeBSD

Map IPv6 link-local prefix to the link-local ifa.
ClosedPublic

Authored by melifaro on Jan 13 2021, 12:27 AM.
Tags
None
Referenced Files
F83413394: D28129.id.diff
Fri, May 10, 4:54 AM
Unknown Object (File)
Wed, May 1, 9:45 PM
Unknown Object (File)
Tue, Apr 30, 7:10 AM
Unknown Object (File)
Tue, Apr 30, 7:10 AM
Unknown Object (File)
Tue, Apr 30, 7:10 AM
Unknown Object (File)
Mon, Apr 29, 11:41 PM
Unknown Object (File)
Thu, Apr 25, 11:34 AM
Unknown Object (File)
Thu, Apr 25, 9:38 AM
Subscribers

Details

Summary

Currently we create link-local route by creating an always-on IPv6 prefix in the prefix list. This prefix is not tied to the link-local ifa.

This leads to the following problems:

  • When flushing interface addresses we skip on-link route, leaving fe80::/64 prefix on the interface w/o any IPv6 addresses.
  • When creating and removing link-local alias we lose fe80::/64 prefix

Fix this by attaching ifa to the prefix at the initial creation.

Test Plan

Before:

0:29 [0] devel1# ifconfig vlan5 inet6
vlan5: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=680703<RXCSUM,TXCSUM,TSO4,TSO6,LRO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 2a02:6b8::1 prefixlen 63
        inet6 fe80::5054:ff:fe52:3e90%vlan5 prefixlen 64 scopeid 0xd
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
0:29 [0] devel1# netstat -6rn | grep vlan5
2a02:6b8::/63                     link#13                       U         vlan5
fe80::%vlan5/64                   link#13                       U         vlan5
fe80::5054:ff:fe52:3e90%vlan5     link#2                        UHS         lo0
0:29 [0] devel1#
0:29 [0] devel1# ifconfig vlan5 inet6 fe80::1/64
0:29 [0] devel1# netstat -6rn | grep vlan5
2a02:6b8::/63                     link#13                       U         vlan5
fe80::%vlan5/64                   link#13                       U         vlan5
fe80::1%vlan5                     link#2                        UHS         lo0
fe80::5054:ff:fe52:3e90%vlan5     link#2                        UHS         lo0
0:29 [0] devel1# ifconfig vlan5 inet6 fe80::1 delete
0:29 [0] devel1# netstat -6rn | grep vlan5
2a02:6b8::/63                     link#13                       U         vlan5
fe80::5054:ff:fe52:3e90%vlan5     link#2                        UHS         lo0
0:29 [0] devel1#

After:

0:30 [1] m@devel0 netstat -6rn | grep vlan5
2a02:978::/64                     link#5                        U         vlan5
fe80::%vlan5/64                   link#5                        U         vlan5
fe80::5054:ff:fe42:fef%vlan5      link#5                        UHS         lo0
0:30 [1] m@devel0 s ifconfig vlan5 inet6 fe80::1/64
0:30 [1] m@devel0 netstat -6rn | grep vlan5
2a02:978::/64                     link#5                        U         vlan5
fe80::%vlan5/64                   link#5                        U         vlan5
fe80::1%vlan5                     link#5                        UHS         lo0
fe80::5054:ff:fe42:fef%vlan5      link#5                        UHS         lo0
0:30 [1] m@devel0 s ifconfig vlan5 inet6 fe80::1 delete
0:30 [1] m@devel0 netstat -6rn | grep vlan5
2a02:978::/64                     link#5                        U         vlan5
fe80::%vlan5/64                   link#5                        U         vlan5
fe80::5054:ff:fe42:fef%vlan5      link#5                        UHS         lo0

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable