cvs commit: src/sys/net if_gif.c

Brooks Davis brooks at one-eyed-alien.net
Tue Mar 30 15:25:29 PST 2004


On Wed, Mar 31, 2004 at 01:03:49AM +0300, Ruslan Ermilov wrote:
> On Mon, Mar 22, 2004 at 06:24:26AM -0800, Robert Watson wrote:
> > rwatson     2004/03/22 06:24:26 PST
> > 
> >   FreeBSD src repository
> > 
> >   Modified files:
> >     sys/net              if_gif.c 
> >   Log:
> >   Move "called", a static function variable used to detect recursive
> >   processing with gif interfaces, to a global variable named "gif_called".
> >   Add an annotation that this approach will not work with a reentrant
> >   network stack, and that we should instead use packet tags to detect
> >   excessive recursive processing.
> >   
> >   Revision  Changes    Path
> >   1.42      +11 -4     src/sys/net/if_gif.c
> > 
> Implemented this in the attached patch.  Note when testing: setting
> net.link.gif.max_nesting too high (>20 on my system) and triggering
> the recursion causes the kernel stack exhaustion.

Why not just do what OpenBSD does and do actual loop detection?  This
gets rid of the nesting count hack which isn't really what you want to
measure anyway.

http://www.openbsd.org/cgi-bin/cvsweb/src/sys/net/if_gif.c.diff?r1=1.18&r2=1.19

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20040330/2e6c7be0/attachment.bin


More information about the cvs-all mailing list