diff options
author | glebius <glebius@FreeBSD.org> | 2004-12-09 09:48:47 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2004-12-09 09:48:47 +0000 |
commit | 9fdc5dd01adfa47678c680af97ce19249f6240e1 (patch) | |
tree | 698d47c9f318769c2ddb7782b6d1de205b1239ba /sys/netinet6/in6_gif.c | |
parent | ce23ffb82d0d9221c9969313a0bbeeb0af35d7c1 (diff) | |
download | FreeBSD-src-9fdc5dd01adfa47678c680af97ce19249f6240e1.zip FreeBSD-src-9fdc5dd01adfa47678c680af97ce19249f6240e1.tar.gz |
MFinet4:
- Make route cacheing optional, configurable via IFF_LINK0 flag.
- Turn it off by default.
Reminded by: suz
Diffstat (limited to 'sys/netinet6/in6_gif.c')
-rw-r--r-- | sys/netinet6/in6_gif.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index e3cd124..76651f4 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 || @@ -213,10 +213,17 @@ 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) == 0) { + RTFREE(sc->gif_ro6.ro_rt); + sc->gif_ro6.ro_rt = NULL; + } + + return (error); } int |