slirp: Replace m_freem with m_free

Remove this pointless wrapping.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Jan Kiszka 2011-07-20 12:20:16 +02:00 committed by Anthony Liguori
parent 5a82362ad0
commit 3acccfc67d
7 changed files with 16 additions and 19 deletions

View File

@ -81,7 +81,7 @@ icmp_input(struct mbuf *m, int hlen)
*/
if (icmplen < ICMP_MINLEN) { /* min 8 bytes payload */
freeit:
m_freem(m);
m_free(m);
goto end_error;
}
@ -155,11 +155,11 @@ icmp_input(struct mbuf *m, int hlen)
case ICMP_TSTAMP:
case ICMP_MASKREQ:
case ICMP_REDIRECT:
m_freem(m);
m_free(m);
break;
default:
m_freem(m);
m_free(m);
} /* swith */
end_error:

View File

@ -204,7 +204,7 @@ ip_input(struct mbuf *m)
}
return;
bad:
m_freem(m);
m_free(m);
return;
}
@ -297,7 +297,7 @@ ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp)
break;
}
q = q->ipf_next;
m_freem(dtom(slirp, q->ipf_prev));
m_free(dtom(slirp, q->ipf_prev));
ip_deq(q->ipf_prev);
}
@ -363,7 +363,7 @@ insert:
return ip;
dropfrag:
m_freem(m);
m_free(m);
return NULL;
}
@ -379,7 +379,7 @@ ip_freef(Slirp *slirp, struct ipq *fp)
for (q = fp->frag_link.next; q != (struct ipasfrag*)&fp->frag_link; q = p) {
p = q->ipf_next;
ip_deq(q);
m_freem(dtom(slirp, q));
m_free(dtom(slirp, q));
}
remque(&fp->ip_link);
(void) m_free(dtom(slirp, fp));

View File

@ -159,7 +159,7 @@ sendorfree:
if (error == 0)
if_output(so, m);
else
m_freem(m);
m_free(m);
}
}
@ -167,6 +167,6 @@ done:
return (error);
bad:
m_freem(m0);
m_free(m0);
goto done;
}

View File

@ -33,9 +33,6 @@
#ifndef _MBUF_H_
#define _MBUF_H_
#define m_freem m_free
#define MINCSIZE 4096 /* Amount to increase mbuf if too small */
/*

View File

@ -136,7 +136,7 @@ tcp_reass(register struct tcpcb *tp, register struct tcpiphdr *ti,
i = q->ti_seq + q->ti_len - ti->ti_seq;
if (i > 0) {
if (i >= ti->ti_len) {
m_freem(m);
m_free(m);
/*
* Try to present any queued data
* at the left window edge to the user.
@ -170,7 +170,7 @@ tcp_reass(register struct tcpcb *tp, register struct tcpiphdr *ti,
q = tcpiphdr_next(q);
m = tcpiphdr_prev(q)->ti_mbuf;
remque(tcpiphdr2qlink(tcpiphdr_prev(q)));
m_freem(m);
m_free(m);
}
/*
@ -197,7 +197,7 @@ present:
m = ti->ti_mbuf;
ti = tcpiphdr_next(ti);
if (so->so_state & SS_FCANTSENDMORE)
m_freem(m);
m_free(m);
else {
if (so->so_emu) {
if (tcp_emu(so,m)) sbappend(so, m);
@ -451,7 +451,7 @@ findso:
acked = ti->ti_ack - tp->snd_una;
sbdrop(&so->so_snd, acked);
tp->snd_una = ti->ti_ack;
m_freem(m);
m_free(m);
/*
* If all outstanding data are acked, stop
@ -1260,7 +1260,7 @@ dropafterack:
*/
if (tiflags & TH_RST)
goto drop;
m_freem(m);
m_free(m);
tp->t_flags |= TF_ACKNOW;
(void) tcp_output(tp);
return;

View File

@ -250,7 +250,7 @@ tcp_close(struct tcpcb *tp)
t = tcpiphdr_next(t);
m = tcpiphdr_prev(t)->ti_mbuf;
remque(tcpiphdr2qlink(tcpiphdr_prev(t)));
m_freem(m);
m_free(m);
}
free(tp);
so->so_tcpcb = NULL;

View File

@ -222,7 +222,7 @@ udp_input(register struct mbuf *m, int iphlen)
return;
bad:
m_freem(m);
m_free(m);
return;
}