diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 4ab9b35b8110..25bad0f2d45f 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -168,9 +168,11 @@ udp6_input(mp, offp, proto) /* * Checksum extended UDP header and data. */ - if (uh->uh_sum == 0) + if (uh->uh_sum == 0) { udpstat.udps_nosum++; - else if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) { + goto bad; + } + if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) { udpstat.udps_badsum++; goto bad; }