summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_icmp.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-08-10 02:26:27 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-08-10 02:26:27 +0000
commit089b9fcc6f896445e9b7d3a19c1d46dd9efc841e (patch)
tree4537f4fbfd53df0250534f1e674da159ca42d403 /sys/netinet/ip_icmp.c
parent3e9d1ad9468fa6f1e5819929419e0402560d4564 (diff)
icmp_mtudisc() might be called by TCP even on loopback after a
retransmit timeout. Do not run path MTU discovery on local routes as we never want that on loopback. For permanent ARP or ND entries disable path MTU discovery as they use the same rt_expire field. This prevents that permanent routes and entries disappear. bug analysis friehm@; OK mpi@
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r--sys/netinet/ip_icmp.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index a30c96d7253..cdfa20cccd7 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.170 2017/06/19 17:58:49 bluhm Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.171 2017/08/10 02:26:26 bluhm Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -961,6 +961,16 @@ icmp_mtudisc_clone(struct in_addr dst, u_int rtableid)
return (NULL);
}
+ /*
+ * No PMTU for local routes and permanent neighbors,
+ * ARP and NDP use the same expire timer as the route.
+ */
+ if (ISSET(rt->rt_flags, RTF_LOCAL) ||
+ (ISSET(rt->rt_flags, RTF_LLINFO) && rt->rt_expire == 0)) {
+ rtfree(rt);
+ return (NULL);
+ }
+
/* If we didn't get a host route, allocate one */
if ((rt->rt_flags & RTF_HOST) == 0) {
struct rtentry *nrt;