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

View File

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

View File

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

View File

@ -33,9 +33,6 @@
#ifndef _MBUF_H_ #ifndef _MBUF_H_
#define _MBUF_H_ #define _MBUF_H_
#define m_freem m_free
#define MINCSIZE 4096 /* Amount to increase mbuf if too small */ #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; i = q->ti_seq + q->ti_len - ti->ti_seq;
if (i > 0) { if (i > 0) {
if (i >= ti->ti_len) { if (i >= ti->ti_len) {
m_freem(m); m_free(m);
/* /*
* Try to present any queued data * Try to present any queued data
* at the left window edge to the user. * 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); q = tcpiphdr_next(q);
m = tcpiphdr_prev(q)->ti_mbuf; m = tcpiphdr_prev(q)->ti_mbuf;
remque(tcpiphdr2qlink(tcpiphdr_prev(q))); remque(tcpiphdr2qlink(tcpiphdr_prev(q)));
m_freem(m); m_free(m);
} }
/* /*
@ -197,7 +197,7 @@ present:
m = ti->ti_mbuf; m = ti->ti_mbuf;
ti = tcpiphdr_next(ti); ti = tcpiphdr_next(ti);
if (so->so_state & SS_FCANTSENDMORE) if (so->so_state & SS_FCANTSENDMORE)
m_freem(m); m_free(m);
else { else {
if (so->so_emu) { if (so->so_emu) {
if (tcp_emu(so,m)) sbappend(so, m); if (tcp_emu(so,m)) sbappend(so, m);
@ -451,7 +451,7 @@ findso:
acked = ti->ti_ack - tp->snd_una; acked = ti->ti_ack - tp->snd_una;
sbdrop(&so->so_snd, acked); sbdrop(&so->so_snd, acked);
tp->snd_una = ti->ti_ack; tp->snd_una = ti->ti_ack;
m_freem(m); m_free(m);
/* /*
* If all outstanding data are acked, stop * If all outstanding data are acked, stop
@ -1260,7 +1260,7 @@ dropafterack:
*/ */
if (tiflags & TH_RST) if (tiflags & TH_RST)
goto drop; goto drop;
m_freem(m); m_free(m);
tp->t_flags |= TF_ACKNOW; tp->t_flags |= TF_ACKNOW;
(void) tcp_output(tp); (void) tcp_output(tp);
return; return;

View File

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

View File

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