From dcccd3d8ca02684d9cc8a31ee368d2fa8a84c425 Mon Sep 17 00:00:00 2001 From: tuexen Date: Mon, 6 Oct 2014 17:14:31 +0000 Subject: MFC r272469: UDP/IPv6 and UDPLite/IPv6 require a checksum. So check for it. --- sys/netinet6/udp6_usrreq.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys/netinet6') diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index b837601..49b8490 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -235,11 +235,19 @@ udp6_input(struct mbuf **mp, int *offp, int proto) /* XXX: What is the right UDPLite MIB counter? */ goto badunlocked; } + if (uh->uh_sum == 0) { + /* XXX: What is the right UDPLite MIB counter? */ + goto badunlocked; + } } else { if ((ulen < sizeof(struct udphdr)) || (plen != ulen)) { UDPSTAT_INC(udps_badlen); goto badunlocked; } + if (uh->uh_sum == 0) { + UDPSTAT_INC(udps_nosum); + goto badunlocked; + } } if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) && -- cgit v1.1