From a7596d191220014555e41fc502807010a91da61f Mon Sep 17 00:00:00 2001 From: itojun Date: Thu, 24 May 2001 07:22:27 +0000 Subject: [PATCH] call icmp6_mtudisc_update(foo, 0) even if ICMPv6 messages are very short. let icmp6 layer decide whether we take PMTUD routes or not. --- sys/netinet/tcp_subr.c | 9 +++++++-- sys/netinet6/udp6_usrreq.c | 7 +++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 99d8d7adece3..af11deb71a01 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_subr.c,v 1.109 2001/03/21 03:35:11 chs Exp $ */ +/* $NetBSD: tcp_subr.c,v 1.110 2001/05/24 07:22:27 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -1170,8 +1170,11 @@ tcp6_ctlinput(cmd, sa, d) */ /* check if we can safely examine src and dst ports */ - if (m->m_pkthdr.len < off + sizeof(th)) + if (m->m_pkthdr.len < off + sizeof(th)) { + if (cmd == PRC_MSGSIZE) + icmp6_mtudisc_update((struct ip6ctlparam *)d, 0); return; + } bzero(&th, sizeof(th)); m_copydata(m, off, sizeof(th), (caddr_t)&th); @@ -1251,6 +1254,8 @@ tcp_ctlinput(cmd, sa, v) * Check to see if we have a valid TCP connection * corresponding to the address in the ICMP message * payload. + * + * Boundary check is made in icmp_input(), with ICMP_ADVLENMIN. */ th = (struct tcphdr *)((caddr_t)ip + (ip->ip_hl << 2)); if (in_pcblookup_connect(&tcbtable, diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index e9e3413f83c5..668584324359 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: udp6_usrreq.c,v 1.41 2001/05/08 10:15:15 itojun Exp $ */ +/* $NetBSD: udp6_usrreq.c,v 1.42 2001/05/24 07:22:28 itojun Exp $ */ /* $KAME: udp6_usrreq.c,v 1.84 2001/02/07 07:38:25 itojun Exp $ */ /* @@ -521,8 +521,11 @@ udp6_ctlinput(cmd, sa, d) */ /* check if we can safely examine src and dst ports */ - if (m->m_pkthdr.len < off + sizeof(*uhp)) + if (m->m_pkthdr.len < off + sizeof(*uhp)) { + if (cmd == PRC_MSGSIZE) + icmp6_mtudisc_update((struct ip6ctlparam *)d, 0); return; + } bzero(&uh, sizeof(uh)); m_copydata(m, off, sizeof(*uhp), (caddr_t)&uh);