Subject: masanobu@iij.ad.jp, msaitoh@netbsd.org
To: None <tech-net@netbsd.org>
From: SAITOH Masanobu <masanobu@iij.ad.jp>
List: tech-net
Date: 03/06/2006 18:41:27
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?
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)