cvs commit: src/sys/netinet in_gif.c

Andre Oppermann andre at freebsd.org
Thu Dec 9 07:26:48 PST 2004


Ruslan Ermilov wrote:
> 
> On Mon, Dec 06, 2004 at 07:02:43PM +0000, Gleb Smirnoff wrote:
> > glebius     2004-12-06 19:02:43 UTC
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sys/netinet          in_gif.c
> >   Log:
> >   - Make route cacheing optional, configurable via IFF_LINK0 flag.
> >   - Turn it off by default.
> >
> >   Requested by:   many
> >   Reviewed by:    andre
> >   Approved by:    julian (mentor)
> >   MFC after:      3 days
> >
> >   Revision  Changes    Path
> >   1.27      +6 -0      src/sys/netinet/in_gif.c
> >
> This looks suboptimal.  In the !IFF_LINK0 case, I suggest
> not messing with sc->gif_ro at all and passing ip_output()
> a NULL route pointer.  Loop detection here is incomplete,
> and the correct detection is already done in if_gif.c.
> Other route checks just duplicate existing functionality.
> 
> By the way, I have a WIP (attached) that adds versioning
> to the routing table.  Whenever a routing table is altered,
> the version is bumped.  The primary intent is for cached
> routes, and it was invented specifically to address this
> gif(4) problem, but also the remnants of PR kern/10778.

Route caching at the consumers of the route API is evil and
should be avoided.  If there is any caching it should be in
or managed by the route lookup function in one central place.
This also helps to avoid concurrency and locking issues.
IMO this is the only way to go and where I want to end up in
a not too distant future.

-- 
Andre


More information about the cvs-src mailing list