diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-02-09 13:23:40 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-02-09 13:23:40 +0000 |
commit | 304ea2e17ea69d855338258a797619d7ab9e32fb (patch) | |
tree | c61bff61678097a988d6dff15f590ebaab55aa8b /sys/netinet/ip_icmp.c | |
parent | a189831e7c65a19a36ead747197f232d369cdcc9 (diff) |
Before cloning a route to change the MTU check that the route we clone from
is valid and usable (reject and blackholes are not conidered usable).
TCP has this nasty behaviour to clone routes to disable PMTU and this combined
with dynamic routing resulted in dead sessions when there was a default reject
route installed.
OK henning@, sthen@
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r-- | sys/netinet/ip_icmp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index e1aeed69ade..ac67e4333e7 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.86 2009/11/13 20:54:05 claudio Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.87 2010/02/09 13:23:39 claudio Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -881,6 +881,11 @@ icmp_mtudisc_clone(struct sockaddr *dst, u_int rtableid) if (rt == 0) return (NULL); + /* Check if the route is actually usable */ + if (rt->rt_flags & (RTF_REJECT | RTF_BLACKHOLE) || + (rt->rt_flags & RTF_UP) == 0) + return (NULL); + /* If we didn't get a host route, allocate one */ if ((rt->rt_flags & RTF_HOST) == 0) { |