diff options
author | glebius <glebius@FreeBSD.org> | 2004-12-10 07:51:14 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2004-12-10 07:51:14 +0000 |
commit | 16a5d8193f49035546afed8c166c4548d208f9ee (patch) | |
tree | ac6a02d0735a468db9904e7613e16e79b9868a56 | |
parent | c08591ffd6bea89df080313bd3310d8170c2517b (diff) | |
download | FreeBSD-src-16a5d8193f49035546afed8c166c4548d208f9ee.zip FreeBSD-src-16a5d8193f49035546afed8c166c4548d208f9ee.tar.gz |
In certain cases ip_output() can free our route, so check
for its presence before RTFREE().
Noticed by: ru
-rw-r--r-- | sys/netinet/in_gif.c | 3 | ||||
-rw-r--r-- | sys/netinet6/in6_gif.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index 41e7691..3043c80 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -210,7 +210,8 @@ in_gif_output(ifp, family, m) error = ip_output(m, NULL, &sc->gif_ro, 0, NULL, NULL); - if ((sc->gif_if.if_flags & IFF_LINK0) == 0) { + if (!(sc->gif_if.if_flags & IFF_LINK0) && + sc->gif_ro.ro_rt != NULL) { RTFREE(sc->gif_ro.ro_rt); sc->gif_ro.ro_rt = NULL; } diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index b3cb4f1..b17ded1 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -218,7 +218,8 @@ in6_gif_output(ifp, family, m) error = ip6_output(m, 0, &sc->gif_ro6, 0, 0, NULL, NULL); #endif - if ((sc->gif_if.if_flags & IFF_LINK0) == 0) { + if (!(sc->gif_if.if_flags & IFF_LINK0) && + sc->gif_ro6.ro_rt != NULL) { RTFREE(sc->gif_ro6.ro_rt); sc->gif_ro6.ro_rt = NULL; } |