Subject: Re: masanobu@iij.ad.jp, msaitoh@netbsd.org
To: SAITOH Masanobu <masanobu@iij.ad.jp>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-net
Date: 03/06/2006 10:24:06
On Mar 6, 2006, at 1:41 AM, SAITOH Masanobu wrote:
>
> if_gif.c::gif_set_tunnel() doesn't call softintr_disestablish() for
> previous software interrupt, so it causes memory leak. Is there any
> intention or simple bug?
Looks like a bug to me... please feel free to check in your fix.
>
> Index: if_gif.c
> ===================================================================
> RCS file: /cvsroot/src/sys/net/if_gif.c,v
> retrieving revision 1.57
> diff -u -r1.57 if_gif.c
> --- if_gif.c 28 Dec 2005 09:08:20 -0000 1.57
> +++ if_gif.c 6 Mar 2006 08:18:16 -0000
> @@ -845,6 +845,13 @@
> /* XXX both end must be valid? (I mean, not 0.0.0.0) */
> }
>
> +#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
> + if (sc->gif_si) {
> + softintr_disestablish(sc->gif_si);
> + sc->gif_si = NULL;
> + }
> +#endif
> +
> /* XXX we can detach from both, but be polite just in case */
> if (sc->gif_psrc)
> switch (sc->gif_psrc->sa_family) {
>
> BTW, I don't know whether the rollback code in this function works
> correctly or not.... (buggy?)
>
> ----------------------------------------------------------
> SAITOH Masanobu (masanobu@iij.ad.jp
> msaitoh@netbsd.org)
-- thorpej