diff options
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r-- | sys/netinet/ip_output.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 4c22a5e..994cc98 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -31,9 +31,11 @@ * SUCH DAMAGE. * * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 + * $Id: ip_output.c,v 1.4 1994/08/02 07:48:45 davidg Exp $ */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/malloc.h> #include <sys/mbuf.h> #include <sys/errno.h> @@ -55,6 +57,8 @@ #include <machine/mtpr.h> #endif +u_short ip_id; + static struct mbuf *ip_insertoptions __P((struct mbuf *, struct mbuf *, int *)); static void ip_mloopback __P((struct ifnet *, struct mbuf *, struct sockaddr_in *)); @@ -254,6 +258,16 @@ ip_output(m0, opt, ro, flags, imo) ip->ip_src = IA_SIN(ia)->sin_addr; #endif /* + * Verify that we have any chance at all of being able to queue + * the packet or packet fragments + */ + if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >= + ifp->if_snd.ifq_maxlen) { + error = ENOBUFS; + goto bad; + } + + /* * Look for broadcast address and * and verify user is allowed to send * such a packet. @@ -483,7 +497,7 @@ ip_ctloutput(op, so, level, optname, mp) { register struct inpcb *inp = sotoinpcb(so); register struct mbuf *m = *mp; - register int optval; + register int optval = 0; int error = 0; if (level != IPPROTO_IP) { |