diff options
author | tuexen <tuexen@FreeBSD.org> | 2014-10-06 16:59:25 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2014-10-06 16:59:25 +0000 |
commit | ce3a76b52fb6ecf2961794008957eb6fb1d7c450 (patch) | |
tree | 46f5c201d1f7053c3b239ac9ac85a084f12c860b /sys | |
parent | 7da2f7e9ed9db8a99ff6ad3441a5114a935e4748 (diff) | |
download | FreeBSD-src-ce3a76b52fb6ecf2961794008957eb6fb1d7c450.zip FreeBSD-src-ce3a76b52fb6ecf2961794008957eb6fb1d7c450.tar.gz |
MFC r272326:
UDPLite requires a checksum. Therefore, discard a received packet if
the checksum is 0.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index a02846d..52bc07a 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -488,8 +488,16 @@ udp_input(struct mbuf *m, int off) m_freem(m); return; } - } else - UDPSTAT_INC(udps_nosum); + } else { + if (pr == IPPROTO_UDP) { + UDPSTAT_INC(udps_nosum); + } else { + /* UDPLite requires a checksum */ + /* XXX: What is the right UDPLite MIB counter here? */ + m_freem(m); + return; + } + } pcbinfo = get_inpcbinfo(pr); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || |