]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Merge helper fib* functions used for basic lookups.
authorAlexander V. Chernikov <melifaro@FreeBSD.org>
Tue, 8 Dec 2015 10:50:03 +0000 (10:50 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Tue, 8 Dec 2015 10:50:03 +0000 (10:50 +0000)
commit65ff3638df7d7d993e284971e2c78b3ca9613c8d
tree6ca921174b94c73570e52b7776a5a84068f7a02f
parentb2a78a9d85e5c7c0ede74119a2515adda06be635
Merge helper fib* functions used for basic lookups.

Vast majority of rtalloc(9) users require only basic info from
route table (e.g. "does the rtentry interface match with the interface
  I have?". "what is the MTU?", "Give me the IPv4 source address to use",
  etc..).
Instead of hand-rolling lookups, checking if rtentry is up, valid,
  dealing with IPv6 mtu, finding "address" ifp (almost never done right),
  provide easy-to-use API hiding all the complexity and returning the
  needed info into small on-stack structure.

This change also helps hiding route subsystem internals (locking, direct
  rtentry accesses).
Additionaly, using this API improves lookup performance since rtentry is not
  locked.
(This is safe, since all the rtentry changes happens under both radix WLOCK
  and rtentry WLOCK).

Sponsored by: Yandex LLC
12 files changed:
sys/conf/files
sys/net/route.h
sys/netinet/in_fib.c [new file with mode: 0644]
sys/netinet/in_fib.h [new file with mode: 0644]
sys/netinet/in_gif.c
sys/netinet/ip_options.c
sys/netinet6/in6_fib.c [new file with mode: 0644]
sys/netinet6/in6_fib.h [new file with mode: 0644]
sys/netinet6/in6_gif.c
sys/netinet6/scope6.c
sys/netinet6/scope6_var.h
sys/netpfil/ipfw/ip_fw2.c