Page MenuHomeFreeBSD

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

Authored by melifaro on Wed, Jan 13, 12:27 AM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.