summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2004-12-11 20:39:12 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2004-12-11 20:39:12 +0000
commit09ed67647322feff4729f392a40b72d151aaa06f (patch)
tree843b247381a9a4e6ae030abcebb9c945c2c6b8e7 /sys
parent72021241cb06c626d5b50cad62e9af46312cad24 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/in_gif.c9
-rw-r--r--sys/netinet6/in6_gif.c14
2 files changed, 19 insertions, 4 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c
index 67ef09b1bd1a..3fbf85e1f75f 100644
--- a/sys/netinet/in_gif.c
+++ b/sys/netinet/in_gif.c
@@ -205,7 +205,14 @@ in_gif_output(ifp, family, m)
}
error = ip_output(m, NULL, &sc->gif_ro, 0, NULL, NULL);
- return(error);
+
+ 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;
+ }
+
+ return (error);
}
void
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c
index 165533d92824..f2918a77ef06 100644
--- a/sys/netinet6/in6_gif.c
+++ b/sys/netinet6/in6_gif.c
@@ -93,7 +93,7 @@ in6_gif_output(ifp, family, m)
struct sockaddr_in6 *sin6_src = (struct sockaddr_in6 *)sc->gif_psrc;
struct sockaddr_in6 *sin6_dst = (struct sockaddr_in6 *)sc->gif_pdst;
struct ip6_hdr *ip6;
- int proto;
+ int proto, error;
u_int8_t itos, otos;
if (sin6_src == NULL || sin6_dst == NULL ||
@@ -215,10 +215,18 @@ in6_gif_output(ifp, family, m)
* it is too painful to ask for resend of inner packet, to achieve
* path MTU discovery for encapsulated packets.
*/
- return(ip6_output(m, 0, &sc->gif_ro6, IPV6_MINMTU, 0, NULL, NULL));
+ error = ip6_output(m, 0, &sc->gif_ro6, IPV6_MINMTU, 0, NULL, NULL);
#else
- return(ip6_output(m, 0, &sc->gif_ro6, 0, 0, NULL, NULL));
+ error = ip6_output(m, 0, &sc->gif_ro6, 0, 0, NULL, NULL);
#endif
+
+ 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;
+ }
+
+ return (error);
}
int in6_gif_input(mp, offp, proto)