Date: Tue, 30 Sep 2014 18:17:29 +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: r272323 - in head/sys: netinet netinet6 Message-ID: <201409301817.s8UIHTAf036419@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Tue Sep 30 18:17:28 2014 New Revision: 272323 URL: http://svnweb.freebsd.org/changeset/base/272323 Log: If the checksum coverage field in the UDPLITE header is the length of the complete UDPLITE packet, the packet has full checksum coverage. SO fix the condition. Reviewed by: kevlo MFC after: 3 days Modified: head/sys/netinet/udp_usrreq.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Sep 30 17:54:57 2014 (r272322) +++ head/sys/netinet/udp_usrreq.c Tue Sep 30 18:17:28 2014 (r272323) @@ -444,9 +444,10 @@ udp_input(struct mbuf **mp, int *offp, i */ len = ntohs((u_short)uh->uh_ulen); ip_len = ntohs(ip->ip_len) - iphlen; - if (proto == IPPROTO_UDPLITE && len == 0) { + if (proto == IPPROTO_UDPLITE && (len == 0 || len == ip_len)) { /* Zero means checksum over the complete packet. */ - len = ip_len; + if (len == 0) + len = ip_len; cscov_partial = 0; } if (ip_len != len) { Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue Sep 30 17:54:57 2014 (r272322) +++ head/sys/netinet6/udp6_usrreq.c Tue Sep 30 18:17:28 2014 (r272323) @@ -227,9 +227,10 @@ udp6_input(struct mbuf **mp, int *offp, nxt = ip6->ip6_nxt; cscov_partial = (nxt == IPPROTO_UDPLITE) ? 1 : 0; - if (nxt == IPPROTO_UDPLITE && ulen == 0) { + if (nxt == IPPROTO_UDPLITE && (ulen == 0 || ulen == plen)) { /* Zero means checksum over the complete packet. */ - ulen = plen; + if (ulen == 0) + ulen = plen; cscov_partial = 0; } if (nxt == IPPROTO_UDP && plen != ulen) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409301817.s8UIHTAf036419>