]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Merge helper fib* functions used for basic lookups.
authormelifaro <melifaro@FreeBSD.org>
Tue, 8 Dec 2015 10:50:03 +0000 (10:50 +0000)
committermelifaro <melifaro@FreeBSD.org>
Tue, 8 Dec 2015 10:50:03 +0000 (10:50 +0000)
commitca13483a3ceb41301eee9d9d194676056a9b304a
tree6ca921174b94c73570e52b7776a5a84068f7a02f
parent857f62b52e4aba63ee7b8c0eeaba0da2e8ae21e5
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