diff options
author | tuexen <tuexen@FreeBSD.org> | 2014-10-06 17:14:31 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2014-10-06 17:14:31 +0000 |
commit | dcccd3d8ca02684d9cc8a31ee368d2fa8a84c425 (patch) | |
tree | 165d32d8ce89c7d6626129c74864c3b5564098cb | |
parent | ec9e40767d3faae9db7fd358a829730a1f82a2b4 (diff) | |
download | FreeBSD-src-dcccd3d8ca02684d9cc8a31ee368d2fa8a84c425.zip FreeBSD-src-dcccd3d8ca02684d9cc8a31ee368d2fa8a84c425.tar.gz |
MFC r272469:
UDP/IPv6 and UDPLite/IPv6 require a checksum. So check for it.
-rw-r--r-- | sys/netinet6/udp6_usrreq.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) && |