08e6f22226
from the forwarding table's users: Introduce rt_walktree() for walking the routing table and applying a function to each rtentry. Replace most rn_walktree() calls with it. Use rt_getkey()/rt_setkey() to get/set a route's destination. Keep a pointer to the sockaddr key in the rtentry, so that rtentry users do not have to grovel in the radix_node for the key. Add a RTM_GET method to rtrequest. Use that instead of radix_node lookups in, e.g., carp(4). Add sys/net/link_proto.c, which supplies sockaddr routines for link-layer socket addresses (sockaddr_dl). Cosmetic: Constify. KNF. Stop open-coding LIST_FOREACH, TAILQ_FOREACH, et cetera. Use NULL instead of 0 for null pointers. Use __arraycount(). Reduce gratuitous parenthesization. Stop using variadic arguments for rip6_output(), it is unnecessary. Remove the unnecessary rtentry member rt_genmask and the code to maintain it, since nothing actually used it. Make rt_maskedcopy() easier to read by using meaningful variable names. Extract a subroutine intern_netmask() for looking up a netmask in the masks table. Start converting backslash-ridden IPv6 macros in sys/netinet6/in6_var.h into inline subroutines that one can read without special eyeglasses. One functional change: when the kernel serves an RTM_GET, RTM_LOCK, or RTM_CHANGE request, it applies the netmask (if supplied) to a destination before searching for it in the forwarding table. I have changed sys/netinet/ip_carp.c, carp_setroute(), to remove the unlawful radix_node knowledge. Apart from the changes to carp(4), netiso, ATM, and strip(4), I have run the changes on three nodes in my wireless routing testbed, which involves IPv4 + IPv6 dynamic routing acrobatics, and it's working beautifully so far. |
||
---|---|---|
.. | ||
ah_aesxcbcmac.c | ||
ah_aesxcbcmac.h | ||
ah_core.c | ||
ah_input.c | ||
ah_output.c | ||
ah.h | ||
dest6.c | ||
esp_aesctr.c | ||
esp_aesctr.h | ||
esp_core.c | ||
esp_input.c | ||
esp_output.c | ||
esp_rijndael.c | ||
esp_rijndael.h | ||
esp.h | ||
files.ipsec | ||
files.netinet6 | ||
frag6.c | ||
icmp6.c | ||
in6_cksum.c | ||
in6_gif.c | ||
in6_gif.h | ||
in6_ifattach.c | ||
in6_ifattach.h | ||
in6_offload.c | ||
in6_offload.h | ||
in6_pcb.c | ||
in6_pcb.h | ||
in6_proto.c | ||
in6_src.c | ||
in6_var.h | ||
in6.c | ||
in6.h | ||
ip6_etherip.c | ||
ip6_etherip.h | ||
ip6_flow.c | ||
ip6_forward.c | ||
ip6_id.c | ||
ip6_input.c | ||
ip6_mroute.c | ||
ip6_mroute.h | ||
ip6_output.c | ||
ip6_var.h | ||
ip6protosw.h | ||
ipcomp_core.c | ||
ipcomp_input.c | ||
ipcomp_output.c | ||
ipcomp.h | ||
ipsec.c | ||
ipsec.h | ||
Makefile | ||
mld6_var.h | ||
mld6.c | ||
nd6_nbr.c | ||
nd6_rtr.c | ||
nd6.c | ||
nd6.h | ||
pim6_var.h | ||
pim6.h | ||
raw_ip6.c | ||
raw_ip6.h | ||
route6.c | ||
scope6_var.h | ||
scope6.c | ||
udp6_output.c | ||
udp6_usrreq.c | ||
udp6_var.h | ||
udp6.h |