From aedcdea1de80439e14e71a1b352067d7794d35dc Mon Sep 17 00:00:00 2001 From: David Greenman Date: Thu, 12 Jan 1995 10:53:25 +0000 Subject: [PATCH] Fixed mbuf lossage when level != IPPROTO_IP. Problem reported by Robert Dobbs, hint from Charles Hannum, fix by me. --- sys/netinet/raw_ip.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 92d5b5ab9ff5..c02cf40a28d4 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 - * $Id: raw_ip.c,v 1.9 1994/12/12 17:20:55 ugen Exp $ + * $Id: raw_ip.c,v 1.10 1994/12/13 15:57:34 ugen Exp $ */ #include @@ -188,8 +188,11 @@ rip_ctloutput(op, so, level, optname, m) register struct inpcb *inp = sotoinpcb(so); register int error; - if (level != IPPROTO_IP) + if (level != IPPROTO_IP) { + if (op == PRCO_SETOPT && *m) + (void)m_free(*m); return (EINVAL); + } switch (optname) {