summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/udp_usrreq.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 1f9319203f4..6f31222a7b0 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.54 2001/02/16 16:17:31 itojun Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.55 2001/03/06 18:34:17 aaron Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -887,6 +887,15 @@ udp_output(m, va_alist)
panic("IPv6 inpcb to udp_output");
#endif
+ /*
+ * Compute the packet length of the IP header, and
+ * punt if the length looks bogus.
+ */
+ if ((len + sizeof(struct udpiphdr)) > IP_MAXPACKET) {
+ error = EMSGSIZE;
+ goto release;
+ }
+
if (addr) {
/*
* Save current PCB flags because they may change during
@@ -925,15 +934,6 @@ udp_output(m, va_alist)
}
/*
- * Compute the packet length of the IP header, and
- * punt if the length looks bogus.
- */
- if ((len + sizeof(struct udpiphdr)) > IP_MAXPACKET) {
- error = EMSGSIZE;
- goto release;
- }
-
- /*
* Fill in mbuf with extended UDP header
* and addresses and length put into network format.
*/