NetBSD/sys/net
dyoung c308b1c661 Here are various changes designed to protect against bad IPv4
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.
2006-12-09 05:33:04 +00:00
..
agr make agr headers include lock.h and queue.h by themselves. 2006-10-29 22:14:14 +00:00
bpf_filter.c
bpf.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
bpf.h
bpfdesc.h
bridgestp.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
bsd-comp.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
dlt.h
ethertypes.h
files.pf
if_arc.h
if_arcsubr.c
if_arp.h
if_atm.h
if_atmsubr.c
if_bridge.c New EtherIP driver based on tap(4) and gif(4) by Hans Rosenfeld. 2006-11-23 04:07:07 +00:00
if_bridgevar.h
if_dl.h
if_eco.h
if_ecosubr.c
if_ether.h The change I committed to etherip was wrong. ether_snprintf doesn't make 2006-11-24 01:04:30 +00:00
if_etherip.c The change I committed to etherip was wrong. ether_snprintf doesn't make 2006-11-24 01:04:30 +00:00
if_etherip.h New EtherIP driver based on tap(4) and gif(4) by Hans Rosenfeld. 2006-11-23 04:07:07 +00:00
if_ethersubr.c Remove an overlapping struct copy from ether_input, which caused address 2006-12-01 18:43:40 +00:00
if_faith.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
if_faith.h
if_fddi.h
if_fddisubr.c
if_gif.c New EtherIP driver based on tap(4) and gif(4) by Hans Rosenfeld. 2006-11-23 04:07:07 +00:00
if_gif.h Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
if_gre.c Per discussion on tech-net@, discard the address-munging hack that 2006-12-04 02:40:15 +00:00
if_gre.h Cosmetic: s/g_proto/sc_proto/. 2006-11-16 22:32:38 +00:00
if_hippi.h
if_hippisubr.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
if_ieee1394.h
if_ieee1394subr.c
if_llc.h
if_loop.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
if_media.c
if_media.h
if_ppp.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
if_ppp.h
if_pppoe.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
if_pppoe.h
if_pppvar.h
if_sl.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
if_slvar.h
if_sppp.h
if_spppsubr.c Correct spelling of "immediate(ly)". From Zafer. 2006-11-24 21:23:07 +00:00
if_spppvar.h
if_stf.c Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
if_stf.h
if_strip.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
if_stripvar.h
if_tap.c The change I committed to etherip was wrong. ether_snprintf doesn't make 2006-11-24 01:04:30 +00:00
if_tap.h
if_token.h
if_tokensubr.c
if_tun.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
if_tun.h
if_types.h
if_vlan.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
if_vlanvar.h
if.c Fix spelling, s/straglers/stragglers/. 2006-12-03 19:17:41 +00:00
if.h implement ipv6 TSO. 2006-11-23 19:41:58 +00:00
Makefile New EtherIP driver based on tap(4) and gif(4) by Hans Rosenfeld. 2006-11-23 04:07:07 +00:00
net_osdep.h
netisr_dispatch.h
netisr.h
pfil.c
pfil.h
pfkeyv2.h
ppp_defs.h
ppp_tty.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
ppp-comp.h
ppp-deflate.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
radix.c Extract subroutines rn_walkfirst() and rn_walknext() from rn_walktree(). 2006-12-04 01:45:50 +00:00
radix.h don't leak kernel variable declarations to userland. 2006-10-22 20:55:09 +00:00
raw_cb.c
raw_cb.h
raw_usrreq.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
route.c Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
route.h Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
rtsock.c make the routing socket report the right source address in RTM_GET 2006-11-13 19:16:01 +00:00
slcompress.c
slcompress.h
slip.h
zlib.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
zlib.h