From owner-svn-src-all@FreeBSD.ORG Tue Sep 30 18:17:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D59561F7; Tue, 30 Sep 2014 18:17:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C209F385; Tue, 30 Sep 2014 18:17:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8UIHTgR036421; Tue, 30 Sep 2014 18:17:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UIHTAf036419; Tue, 30 Sep 2014 18:17:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409301817.s8UIHTAf036419@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 30 Sep 2014 18:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272323 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2014 18:17:29 -0000 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) {