diff options
author | fenner <fenner@FreeBSD.org> | 1996-10-25 17:57:53 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 1996-10-25 17:57:53 +0000 |
commit | aa424264765815c0b549bb0ef4fb82799a34c350 (patch) | |
tree | 3befa5b07bb47bd5b8369c3bd655d60f74ea009c /sys/netinet/udp_usrreq.c | |
parent | ccd3ba3727691f91198db0cc85afabfd9e88a1ea (diff) | |
download | FreeBSD-src-aa424264765815c0b549bb0ef4fb82799a34c350.zip FreeBSD-src-aa424264765815c0b549bb0ef4fb82799a34c350.tar.gz |
Don't allow reassembly to create packets bigger than IP_MAXPACKET, and count
attempts to do so.
Don't allow users to source packets bigger than IP_MAXPACKET.
Make UDP length and ipovly's protocol length unsigned short.
Reviewed by: wollman
Submitted by: (partly by) kml@nas.nasa.gov (Kevin Lahey)
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 0d6994f..4c3c62f 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 - * $Id: udp_usrreq.c,v 1.28 1996/06/08 08:19:03 bde Exp $ + * $Id: udp_usrreq.c,v 1.29 1996/10/07 19:06:12 davidg Exp $ */ #include <sys/param.h> @@ -445,6 +445,11 @@ udp_output(inp, m, addr, control) if (control) m_freem(control); /* XXX */ + if (len + sizeof(struct udpiphdr) > IP_MAXPACKET) { + error = EMSGSIZE; + goto release; + } + if (addr) { laddr = inp->inp_laddr; if (inp->inp_faddr.s_addr != INADDR_ANY) { |