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
Unknown Object (File)
Sun, Nov 3, 7:20 AM
Unknown Object (File)
Sep 11 2024, 12:39 PM
Unknown Object (File)
Sep 5 2024, 7:22 PM
Unknown Object (File)
Aug 14 2024, 9:32 PM
Unknown Object (File)
Aug 12 2024, 5:15 PM
Unknown Object (File)
Jul 28 2024, 4:24 PM
Unknown Object (File)
Jul 10 2024, 10:58 AM
Unknown Object (File)
Jun 2 2024, 12:41 PM
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