diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-02-22 17:43:21 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-02-22 17:43:21 +0000 |
commit | 1a9775f02ffe5c35d739a5be18a3547afb0a07ba (patch) | |
tree | 637d238ac3ce37ff61d3710ee7a23732708a8c52 /sys/netinet6 | |
parent | 0be93a9e595b96936c19ece82e224dfe70924734 (diff) |
In icmp6_mtudisc_update make sure that the requested MTU is not less then
the minimal IPv6 MTU minus the size of a frag header (which is needed because
of a hack in ip6_output/ip6_setpmtu).
Inspired by a similar fix from netbsd. OK markus@, OK deraadt@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/icmp6.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 756d8b36baf..67e3904a4f7 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.103 2009/02/18 20:54:48 claudio Exp $ */ +/* $OpenBSD: icmp6.c,v 1.104 2009/02/22 17:43:20 claudio Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -520,6 +520,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) case ICMP6_PACKET_TOO_BIG: icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_pkttoobig); + /* MTU is checked in icmp6_mtudisc_update. */ code = PRC_MSGSIZE; /* @@ -1108,6 +1109,13 @@ icmp6_mtudisc_update(struct ip6ctlparam *ip6cp, int validated) struct sockaddr_in6 sin6; /* + * The MTU may not be less then the minimal IPv6 MTU except for the + * hack in ip6_output/ip6_setpmtu where we always include a frag header. + */ + if (mtu < IPV6_MMTU - sizeof(struct ip6_frag)) + return; + + /* * allow non-validated cases if memory is plenty, to make traffic * from non-connected pcb happy. */ |