opnsense-src/tests/sys/net
Alexander V. Chernikov 81728a538d Split rtinit() into multiple functions.
rtinit[1]() is a function used to add or remove interface address prefix routes,
  similar to ifa_maintain_loopback_route().
It was intended to be family-agnostic. There is a problem with this approach
 in reality.

1) IPv6 code does not use it for the ifa routes. There is a separate layer,
  nd6_prelist_(), providing interface for maintaining interface routes. Its part,
  responsible for the actual route table interaction, mimics rtenty() code.

2) rtinit tries to combine multiple actions in the same function: constructing
  proper route attributes and handling iterations over multiple fibs, for the
  non-zero net.add_addr_allfibs use case. It notably increases the code complexity.

3) dstaddr handling. flags parameter re-uses RTF_ flags. As there is no special flag
 for p2p connections, host routes and p2p routes are handled in the same way.
 Additionally, mapping IFA flags to RTF flags makes the interface pretty messy.
 It make rtinit() to clash with ifa_mainain_loopback_route() for IPV4 interface
 aliases.

4) rtinit() is the last customer passing non-masked prefixes to rib_action(),
 complicating rib_action() implementation.

5) rtinit() coupled ifa announce/withdrawal notifications, producing "false positive"
 ifa messages in certain corner cases.

To address all these points, the following has been done:

* rtinit() has been split into multiple functions:
- Route attribute construction were moved to the per-address-family functions,
 dealing with (2), (3) and (4).
- funnction providing net.add_addr_allfibs handling and route rtsock notificaions
 is the new routing table inteface.
- rtsock ifa notificaion has been moved out as well. resulting set of funcion are only
 responsible for the actual route notifications.

Side effects:
* /32 alias does not result in interface routes (/32 route and "host" route)
* RTF_PINNED is now set for IPv6 prefixes corresponding to the interface addresses

Differential revision:	https://reviews.freebsd.org/D28186
2021-01-16 22:42:41 +00:00
..
routing Split rtinit() into multiple functions. 2021-01-16 22:42:41 +00:00
if_bridge_test.sh bridge tests: Re-enable STP test 2020-06-07 13:53:02 +00:00
if_clone_test.sh net tests: Re-enable most if_clone tests 2020-12-17 21:54:25 +00:00
if_epair.c Skip if_epair regression test if module doesn't exist 2020-03-03 17:35:15 +00:00
if_lagg_test.sh Skip sys.net.if_lagg_test.lacp_linkstate_destroy_stress in CI because of panic 2020-06-11 18:59:57 +00:00
if_tun_test.sh tun tests: Test renaming and destroying a tun interface in a vnet jail 2019-03-05 15:49:30 +00:00
if_vlan.sh Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q). 2020-10-21 21:28:20 +00:00
Makefile Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00
randsleep.c Properly fix GCC build in r357867 2020-02-14 09:25:29 +00:00