summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/udp_usrreq.c19
-rw-r--r--sys/netinet/udp_var.h3
2 files changed, 12 insertions, 10 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 16dc2dd57a4..b980013e12c 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.21 1999/01/15 12:01:07 niklas Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.22 1999/02/04 16:05:02 deraadt Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -237,13 +237,13 @@ udp_input(m, va_alist)
savesum = uh->uh_sum;
#ifdef INET6
if (ipv6) {
- /*
- * In IPv6, the UDP checksum is ALWAYS used.
- */
- if ((uh->uh_sum = in6_cksum(m, IPPROTO_UDP, len, iphlen))) {
- udpstat.udps_badsum++;
- goto bad;
- }
+ /*
+ * In IPv6, the UDP checksum is ALWAYS used.
+ */
+ if ((uh->uh_sum = in6_cksum(m, IPPROTO_UDP, len, iphlen))) {
+ udpstat.udps_badsum++;
+ goto bad;
+ }
} else
#endif /* INET6 */
if (uh->uh_sum) {
@@ -255,7 +255,8 @@ udp_input(m, va_alist)
m_freem(m);
return;
}
- }
+ } else
+ udpstat.udps_nosum++;
switch (srcsa.sa.sa_family) {
case AF_INET:
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h
index af429702de6..f41b8aa10b5 100644
--- a/sys/netinet/udp_var.h
+++ b/sys/netinet/udp_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_var.h,v 1.6 1998/01/24 18:21:40 mickey Exp $ */
+/* $OpenBSD: udp_var.h,v 1.7 1999/02/04 16:05:02 deraadt Exp $ */
/* $NetBSD: udp_var.h,v 1.12 1996/02/13 23:44:41 christos Exp $ */
/*
@@ -58,6 +58,7 @@ struct udpstat {
u_long udps_ipackets; /* total input packets */
u_long udps_hdrops; /* packet shorter than header */
u_long udps_badsum; /* checksum error */
+ u_long udps_nosum; /* no checksum */
u_long udps_badlen; /* data length larger than packet */
u_long udps_noport; /* no socket on port */
u_long udps_noportbcast; /* of above, arrived as broadcast */