FreeBSD src
Go to file
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
.github/workflows GitHub actions: unbreak macOS build 2021-01-08 15:36:38 +01:00
bin cat: style nits 2021-01-16 12:58:23 +01:00
cddl dtrace tests: fix prototypes for gcc build 2021-01-10 21:53:15 -08:00
contrib Merge bmake-20210110 2021-01-13 22:21:37 -08:00
crypto Merge OpenSSL 1.1.1i. 2020-12-09 02:05:14 +00:00
etc BSD.usr.dist: remove aout 2021-01-07 19:14:01 -05:00
gnu gnu: remove gnugrep and libgnuregex 2020-12-25 15:16:33 -06:00
include pccard: Remove wi(4) driver 2021-01-07 20:41:06 -07:00
kerberos5 Fix more -Wundef warnings during bootstrap 2020-10-14 12:28:54 +00:00
lib Save on getpid in setproctitle by supporting -1 as curproc. 2021-01-16 09:36:54 +01:00
libexec Add 'tmp' to the list of FILESYSTEMS dependencies. Some scripts that 2021-01-15 12:44:06 -08:00
release pkgbase: correct typo in System Accounting Utilities 2021-01-11 08:44:17 -05:00
rescue ping: add a ping6 hard link for backwards compatibility 2020-11-26 18:33:04 +00:00
sbin bectl: remove spurious aok variable 2021-01-16 00:07:50 -06:00
secure caroot: drop $FreeBSD$ expansion from root bundle 2020-12-27 21:47:41 -06:00
share make check: suppress echo of kyua binary location 2021-01-16 00:07:50 -06:00
stand loader.efi: Use Blt with gop as default 2021-01-16 17:39:40 +02:00
sys Split rtinit() into multiple functions. 2021-01-16 22:42:41 +00:00
targets Rename NO_WERROR -> MK_WERROR=no 2021-01-07 09:31:03 +00:00
tests Split rtinit() into multiple functions. 2021-01-16 22:42:41 +00:00
tools Add libclang_rt.profile-powerpc64le.a to (Optional)?ObsoleteFiles.inc 2021-01-16 17:25:56 +01:00
usr.bin elfctl: prefix disable flags with "no" 2021-01-14 15:09:13 -05:00
usr.sbin service.8: Use entire section of literally displayed text 2021-01-16 23:21:05 +01:00
.arcconfig arcconfig: add callsign again 2020-11-23 04:39:29 +00:00
.arclint arc lint: ignore /tests/ in chmod 2017-12-19 03:38:06 +00:00
.cirrus.yml CI: switch to qemu42 package 2020-10-29 02:02:30 +00:00
.clang-format clang-format: Avoid breaking after the opening paren of function definitions 2020-10-28 11:54:00 +00:00
.gitattributes Add a basic clang-format configuration file 2019-06-07 15:23:52 +00:00
.gitignore gitignore: expand list of ignored files 2021-01-14 17:03:57 +01:00
COPYRIGHT copyrights: Happy New Year 2021 2020-12-31 10:29:44 -05:00
LOCKS LOCKS: update current locks 2018-06-09 03:08:04 +00:00
MAINTAINERS Add a pointer to csprng@ for the CSPRNG driver. This is enforced anyway by 2020-09-01 08:02:12 +00:00
Makefile Rename NO_WERROR -> MK_WERROR=no 2021-01-07 09:31:03 +00:00
Makefile.inc1 Revert "pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases" 2021-01-14 14:15:05 +01:00
Makefile.libcompat libcompat: remove redundant path for ncurses 2021-01-07 15:14:52 +01:00
Makefile.sys.inc AUTO_OBJ: For all top-level targets enforce using an OBJDIR. 2017-12-05 21:29:47 +00:00
ObsoleteFiles.inc Add libclang_rt.profile-powerpc64le.a to (Optional)?ObsoleteFiles.inc 2021-01-16 17:25:56 +01:00
README Mark the repository has been converted to Git 2020-12-23 12:27:27 +08:00
README.md Mark the repository has been converted to Git 2020-12-23 12:27:27 +08:00
RELNOTES RELNOTES: correct elfctl(1) man page section 2021-01-14 16:45:58 -05:00
UPDATING pccard: Update UPDATING 2021-01-07 20:41:08 -07:00

FreeBSD Source:

This is the top level of the FreeBSD source directory. This file was last revised on: FreeBSD

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html for more information, including setting make(1) variables.

Source Roadmap:

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

stand		Boot loader sources.

sys		Kernel sources.

sys/<arch>/conf Kernel configuration files. GENERIC is the configuration
		used in release builds. NOTES contains documentation of
		all possible entries.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html