c308b1c661
routing caused by stale route caches (struct route). Route caches are sprinkled throughout PCBs, the IP fast-forwarding table, and IP tunnel interfaces (gre, gif, stf). Stale IPv6 and ISO route caches will be treated by separate patches. Thank you to Christoph Badura for suggesting the general approach to invalidating route caches that I take here. Here are the details: Add hooks to struct domain for tracking and for invalidating each domain's route caches: dom_rtcache, dom_rtflush, and dom_rtflushall. Introduce helper subroutines, rtflush(ro) for invalidating a route cache, rtflushall(family) for invalidating all route caches in a routing domain, and rtcache(ro) for notifying the domain of a new cached route. Chain together all IPv4 route caches where ro_rt != NULL. Provide in_rtcache() for adding a route to the chain. Provide in_rtflush() and in_rtflushall() for invalidating IPv4 route caches. In in_rtflush(), set ro_rt to NULL, and remove the route from the chain. In in_rtflushall(), walk the chain and remove every route cache. In rtrequest1(), call rtflushall() to invalidate route caches when a route is added. In gif(4), discard the workaround for stale caches that involves expiring them every so often. Replace the pattern 'RTFREE(ro->ro_rt); ro->ro_rt = NULL;' with a call to rtflush(ro). Update ipflow_fastforward() and all other users of route caches so that they expect a cached route, ro->ro_rt, to turn to NULL. Take care when moving a 'struct route' to rtflush() the source and to rtcache() the destination. In domain initializers, use .dom_xxx tags. KNF here and there. |
||
---|---|---|
.. | ||
files.ipfilter | ||
files.netinet | ||
icmp6.h | ||
icmp_var.h | ||
if_arp.c | ||
if_atm.c | ||
if_atm.h | ||
if_ether.h | ||
if_inarp.h | ||
igmp_var.h | ||
igmp.c | ||
igmp.h | ||
in4_cksum.c | ||
in_cksum.c | ||
in_gif.c | ||
in_gif.h | ||
in_ifattach.h | ||
in_offload.c | ||
in_offload.h | ||
in_pcb_hdr.h | ||
in_pcb.c | ||
in_pcb.h | ||
in_proto.c | ||
in_proto.h | ||
in_route.c | ||
in_route.h | ||
in_selsrc.c | ||
in_selsrc.h | ||
in_systm.h | ||
in_var.h | ||
in.c | ||
in.h | ||
ip6.h | ||
ip_carp.c | ||
ip_carp.h | ||
ip_ecn.c | ||
ip_ecn.h | ||
ip_encap.c | ||
ip_encap.h | ||
ip_etherip.c | ||
ip_etherip.h | ||
ip_flow.c | ||
ip_gre.c | ||
ip_gre.h | ||
ip_icmp.c | ||
ip_icmp.h | ||
ip_id.c | ||
ip_input.c | ||
ip_mroute.c | ||
ip_mroute.h | ||
ip_output.c | ||
ip_var.h | ||
ip.h | ||
Makefile | ||
pim_var.h | ||
pim.h | ||
raw_ip.c | ||
tcp_congctl.c | ||
tcp_congctl.h | ||
tcp_debug.c | ||
tcp_debug.h | ||
tcp_fsm.h | ||
tcp_input.c | ||
tcp_output.c | ||
tcp_sack.c | ||
tcp_seq.h | ||
tcp_subr.c | ||
tcp_timer.c | ||
tcp_timer.h | ||
tcp_usrreq.c | ||
tcp_var.h | ||
tcp.h | ||
tcpip.h | ||
udp_usrreq.c | ||
udp_var.h | ||
udp.h |