aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2016-06-27 12:41:36 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-07-03 23:59:42 +0200
commit52afc73912cc05d0772597f506194b23a9772a9b (patch)
tree431c3eadfa47992971e18e21fe4f4b70e33fcafb
parente305f3d8cb2281b97707f473252a6a2f6bc39ffa (diff)
downloadslirp-52afc73912cc05d0772597f506194b23a9772a9b.zip
slirp-52afc73912cc05d0772597f506194b23a9772a9b.tar.gz
slirp-52afc73912cc05d0772597f506194b23a9772a9b.tar.bz2
slirp: Remove superfluous memset() calls from the TFTP code
Commit fad7fb9ccd8013ea03 ("Add IPv6 support to the TFTP code") refactored some common code for preparing the mbuf into a new function called tftp_prep_mbuf_data(). One part of this common code is to do a "memset(m->m_data, 0, m->m_size);" for the related buffer first. However, at two spots, the memset() was not removed from the calling function, so it currently done twice in these code paths. Thus let's delete these superfluous memsets in the calling functions now. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-rw-r--r--tftp.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/tftp.c b/tftp.c
index f66c7c4..260e549 100644
--- a/tftp.c
+++ b/tftp.c
@@ -208,8 +208,6 @@ static void tftp_send_error(struct tftp_session *spt, uint16_t errorcode,
goto out;
}
- memset(m->m_data, 0, m->m_size);
-
tp = tftp_prep_mbuf_data(spt, m);
tp->tp_op = htons(TFTP_ERROR);
@@ -237,8 +235,6 @@ static void tftp_send_next_block(struct tftp_session *spt,
return;
}
- memset(m->m_data, 0, m->m_size);
-
tp = tftp_prep_mbuf_data(spt, m);
tp->tp_op = htons(TFTP_DATA);