summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/udp_usrreq.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 561d9bba850..25f22489ba7 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.36 2000/01/04 10:38:36 itojun Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.37 2000/01/07 16:34:10 angelos Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -248,6 +248,12 @@ udp_input(m, va_alist)
}
uh = (struct udphdr *)(mtod(m, caddr_t) + iphlen);
+ /* Check for illegal destination port 0 */
+ if (uh->uh_dport == 0) {
+ udpstat.udps_noport++;
+ goto bad;
+ }
+
/*
* Make mbuf data length reflect UDP length.
* If not enough data to reflect UDP length, drop.