]> Git Repo - qemu.git/commitdiff
slirp: Remove superfluous memset() calls from the TFTP code
authorThomas Huth <[email protected]>
Mon, 27 Jun 2016 10:41:36 +0000 (12:41 +0200)
committerSamuel Thibault <[email protected]>
Sun, 3 Jul 2016 21:59:42 +0000 (23:59 +0200)
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 <[email protected]>
Signed-off-by: Samuel Thibault <[email protected]>
slirp/tftp.c

index 12b5ff6e2595f1bd44a2f402ad0b872952207117..367340222d9b2a032ea09dc30cfc21f3f5171129 100644 (file)
@@ -208,8 +208,6 @@ static void tftp_send_error(struct tftp_session *spt,
     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);
This page took 0.024905 seconds and 4 git commands to generate.