Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/udp_usrreq.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet/udp_usrreq.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.28 retrieving revision 1.29.2.1 diff -u -p -r1.28 -r1.29.2.1 --- src/sys/netinet/udp_usrreq.c 1996/03/16 23:54:03 1.28 +++ src/sys/netinet/udp_usrreq.c 1996/11/10 21:57:55 1.29.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ +/* $NetBSD: udp_usrreq.c,v 1.29.2.1 1996/11/10 21:57:55 thorpej Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -162,7 +162,7 @@ udp_input(m, va_alist) /* * Checksum extended UDP header and data. */ - if (udpcksum && uh->uh_sum) { + if (uh->uh_sum) { bzero(((struct ipovly *)ip)->ih_x1, sizeof ((struct ipovly *)ip)->ih_x1); ((struct ipovly *)ip)->ih_len = uh->uh_ulen; @@ -462,6 +462,15 @@ 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. */