In certain cases ip_output() can free our route, so check

for its presence before RTFREE().

Noticed by:	ru
This commit is contained in:
Gleb Smirnoff 2004-12-10 07:51:14 +00:00
parent d2a09f901a
commit 5e5da86597
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}