summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2006-12-05 09:17:13 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2006-12-05 09:17:13 +0000
commit50eb5159276a43b947584b81a20aea259a7a1f17 (patch)
tree075743c01e77d9a4fd943f08561b7aa0bdde482f /sys/netinet/ip_output.c
parentb22058c5091a5294d4d3451aa1e7640bc0ea851d (diff)
do not install pmtu routes for transport mode SAs, as they do not
the dest IP; PMTU debugging support; ok hshoexer
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 1df80f8c50b..46356b27166 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.183 2006/12/01 12:33:28 henning Exp $ */
+/* $OpenBSD: ip_output.c,v 1.184 2006/12/05 09:17:12 markus Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -602,20 +602,29 @@ sendit:
tdb->tdb_mtutimeout > time_second) {
struct rtentry *rt = NULL;
int rt_mtucloned = 0;
+ int transportmode = 0;
+ transportmode = (tdb->tdb_dst.sa.sa_family == AF_INET) &&
+ (tdb->tdb_dst.sin.sin_addr.s_addr ==
+ ip->ip_dst.s_addr);
icmp_mtu = tdb->tdb_mtu;
splx(s);
/* Find a host route to store the mtu in */
if (ro != NULL)
rt = ro->ro_rt;
- if (rt == NULL || (rt->rt_flags & RTF_HOST) == 0) {
+ /* but don't add a PMTU route for transport mode SAs */
+ if (transportmode)
+ rt = NULL;
+ else if (rt == NULL || (rt->rt_flags & RTF_HOST) == 0) {
struct sockaddr_in dst = {
sizeof(struct sockaddr_in), AF_INET};
dst.sin_addr = ip->ip_dst;
rt = icmp_mtudisc_clone((struct sockaddr *)&dst);
rt_mtucloned = 1;
}
+ DPRINTF(("ip_output: spi %08x mtu %d rt %p cloned %d\n",
+ ntohl(tdb->tdb_spi), icmp_mtu, rt, rt_mtucloned));
if (rt != NULL) {
rt->rt_rmx.rmx_mtu = icmp_mtu;
if (ro && ro->ro_rt != NULL) {