Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2014 20:29:59 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272326 - head/sys/netinet
Message-ID:  <201409302029.s8UKTx0e098653@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Tue Sep 30 20:29:58 2014
New Revision: 272326
URL: http://svnweb.freebsd.org/changeset/base/272326

Log:
  UDPLite requires a checksum. Therefore, discard a received packet if
  the checksum is 0.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c	Tue Sep 30 20:18:10 2014	(r272325)
+++ head/sys/netinet/udp_usrreq.c	Tue Sep 30 20:29:58 2014	(r272326)
@@ -498,8 +498,16 @@ udp_input(struct mbuf **mp, int *offp, i
 			m_freem(m);
 			return (IPPROTO_DONE);
 		}
-	} else
-		UDPSTAT_INC(udps_nosum);
+	} else {
+		if (proto == IPPROTO_UDP) {
+			UDPSTAT_INC(udps_nosum);
+		} else {
+			/* UDPLite requires a checksum */
+			/* XXX: What is the right UDPLite MIB counter here? */
+			m_freem(m);
+			return (IPPROTO_DONE);
+		}
+	}
 
 	pcbinfo = get_inpcbinfo(proto);
 	if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409302029.s8UKTx0e098653>