summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-06-21 18:34:53 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-06-21 18:34:53 +0000
commit2cad447880285e7c39e4688f6f6f37e7d644aeb8 (patch)
tree722e6c8852000a28c0b45f2b5c195fa8173aceb1
parent81dc9ab508c664b361eee9e8b48e62d14f6d0df1 (diff)
don't leak ipsec pmtu routes; with mpf@
-rw-r--r--sys/netinet/ip_output.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index f5dffcf92cf..4d7ac283683 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.163 2004/06/06 16:49:09 cedric Exp $ */
+/* $OpenBSD: ip_output.c,v 1.164 2004/06/21 18:34:52 markus Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -620,6 +620,7 @@ sendit:
ntohs(ip->ip_len) > tdb->tdb_mtu &&
tdb->tdb_mtutimeout > time.tv_sec) {
struct rtentry *rt = NULL;
+ int rt_mtucloned = 0;
icmp_mtu = tdb->tdb_mtu;
splx(s);
@@ -632,6 +633,7 @@ sendit:
sizeof(struct sockaddr_in), AF_INET};
dst.sin_addr = ip->ip_dst;
rt = icmp_mtudisc_clone((struct sockaddr *)&dst);
+ rt_mtucloned = 1;
}
if (rt != NULL) {
rt->rt_rmx.rmx_mtu = icmp_mtu;
@@ -640,6 +642,8 @@ sendit:
ro->ro_rt = (struct rtentry *) 0;
rtalloc(ro);
}
+ if (rt_mtucloned)
+ rtfree(rt);
}
error = EMSGSIZE;
goto bad;