NetBSD/sys/netiso
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
..
xebec
Makefile
README
argo_debug.h
clnl.h
clnp.h
clnp_debug.c
clnp_er.c Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
clnp_frag.c
clnp_input.c use m_adj instead of explicit pointer manipulation 2006-12-05 16:36:14 +00:00
clnp_options.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
clnp_output.c KNF. 2006-12-06 00:39:56 +00:00
clnp_raw.c Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
clnp_stat.h
clnp_subr.c Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
clnp_timer.c
cltp_usrreq.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
cltp_var.h
cons.h
cons_pcb.h
eonvar.h
esis.c Check parameters to avoid potential panic root user. 2006-11-24 12:47:43 +00:00
esis.h
files.netiso
idrp_usrreq.c fix initializers 2006-08-30 15:32:23 +00:00
idrp_var.h
if_cons.c remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP. 2006-09-07 02:40:31 +00:00
if_eon.c Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
iso.c Kill some KAUTH_GENERIC_ISSUSER. 2006-10-25 23:40:57 +00:00
iso.h
iso_chksum.c
iso_errno.h
iso_pcb.c Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
iso_pcb.h
iso_proto.c Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
iso_snpac.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
iso_snpac.h
iso_var.h
tp.trans
tp_astring.c
tp_clnp.h
tp_cons.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
tp_driver.c
tp_emit.c remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP. 2006-09-07 02:40:31 +00:00
tp_events.h
tp_inet.c Remove superfluous parentheses. 2006-12-03 21:56:30 +00:00
tp_input.c remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP. 2006-09-07 02:40:31 +00:00
tp_ip.h
tp_iso.c Here are various changes designed to protect against bad IPv4 2006-12-09 05:33:04 +00:00
tp_meas.c
tp_meas.h
tp_output.c
tp_param.h
tp_pcb.c use c99 initializers 2006-09-03 06:53:08 +00:00
tp_pcb.h
tp_seq.h
tp_stat.h
tp_states.h
tp_states.init
tp_subr.c
tp_subr2.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
tp_timer.c
tp_timer.h
tp_tpdu.h
tp_trace.c
tp_trace.h
tp_user.h
tp_usrreq.c __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
tp_var.h

README

In case you were wondering why this code is still present:

The ISO (or OSI) stack is still in use by many router vendors (e.g., using
IS-IS the OSI equivalent of OSPF, to carry IP routes).

Chris.
chopps@NetBSD.org