diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-08-09 23:52:59 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-10-07 19:40:30 +0200 |
commit | 632dd719b385016eb62273f12fe51512453624c1 (patch) | |
tree | 2f2921546b351d8d59219386a509f76fff8e17dd /slirp/mbuf.c | |
parent | 3c2d3042849686969add641bd38b08b9877b9e8f (diff) | |
download | qemu-632dd719b385016eb62273f12fe51512453624c1.zip qemu-632dd719b385016eb62273f12fe51512453624c1.tar.gz qemu-632dd719b385016eb62273f12fe51512453624c1.tar.bz2 |
slirp: document mbuf pointers and sizes
and fix confusing datasize name into gapsize in m_inc.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/mbuf.c')
-rw-r--r-- | slirp/mbuf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/slirp/mbuf.c b/slirp/mbuf.c index 1b78683..aa1f28a 100644 --- a/slirp/mbuf.c +++ b/slirp/mbuf.c @@ -151,7 +151,7 @@ m_cat(struct mbuf *m, struct mbuf *n) void m_inc(struct mbuf *m, int size) { - int datasize; + int gapsize; /* some compilers throw up on gotos. This one we can fake. */ if (M_ROOM(m) > size) { @@ -159,17 +159,17 @@ m_inc(struct mbuf *m, int size) } if (m->m_flags & M_EXT) { - datasize = m->m_data - m->m_ext; - m->m_ext = g_realloc(m->m_ext, size + datasize); + gapsize = m->m_data - m->m_ext; + m->m_ext = g_realloc(m->m_ext, size + gapsize); } else { - datasize = m->m_data - m->m_dat; - m->m_ext = g_malloc(size + datasize); + gapsize = m->m_data - m->m_dat; + m->m_ext = g_malloc(size + gapsize); memcpy(m->m_ext, m->m_dat, m->m_size); m->m_flags |= M_EXT; } - m->m_data = m->m_ext + datasize; - m->m_size = size + datasize; + m->m_data = m->m_ext + gapsize; + m->m_size = size + gapsize; } |