diff options
author | tuexen <tuexen@FreeBSD.org> | 2014-10-06 13:32:30 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2014-10-06 13:32:30 +0000 |
commit | 952b4cb5f7934b4cb05aa080a728b75bf08c526d (patch) | |
tree | 7f5cae55d609056abf69337985818fb2a0707fdf | |
parent | 70661238f1e61dcf7566dcb3272a496e1229f1a5 (diff) | |
download | FreeBSD-src-952b4cb5f7934b4cb05aa080a728b75bf08c526d.zip FreeBSD-src-952b4cb5f7934b4cb05aa080a728b75bf08c526d.tar.gz |
MFC r272323:
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.
-rw-r--r-- | sys/netinet/udp_usrreq.c | 5 | ||||
-rw-r--r-- | sys/netinet6/udp6_usrreq.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index a3a365a..a02846d 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -434,9 +434,10 @@ udp_input(struct mbuf *m, int off) */ len = ntohs((u_short)uh->uh_ulen); ip_len = ntohs(ip->ip_len) - iphlen; - if (pr == IPPROTO_UDPLITE && len == 0) { + if (pr == 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) { diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 0d68590..0142804 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -225,9 +225,10 @@ udp6_input(struct mbuf **mp, int *offp, int proto) 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) { |