diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2009-06-24 14:42:30 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-29 08:52:47 -0500 |
commit | ef2d54d8df7e4a515b603fe101e73f716d81e778 (patch) | |
tree | 29ad0976650000c311ba428417be34fd8cc77ad2 /slirp/tftp.c | |
parent | f8e3cbd3b5d1c76ec295cfc8858fd696188c270d (diff) |
slirp: tftp: Clean up tftp_send_error
The return code of tftp_send_error is not used, drop it. And also make
sure to always terminate the session.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'slirp/tftp.c')
-rw-r--r-- | slirp/tftp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/slirp/tftp.c b/slirp/tftp.c index 5d5614adc3..75aa4b24f6 100644 --- a/slirp/tftp.c +++ b/slirp/tftp.c @@ -167,11 +167,9 @@ static int tftp_send_oack(struct tftp_session *spt, return 0; } - - -static int tftp_send_error(struct tftp_session *spt, - u_int16_t errorcode, const char *msg, - struct tftp_t *recv_tp) +static void tftp_send_error(struct tftp_session *spt, + u_int16_t errorcode, const char *msg, + struct tftp_t *recv_tp) { struct sockaddr_in saddr, daddr; struct mbuf *m; @@ -181,7 +179,7 @@ static int tftp_send_error(struct tftp_session *spt, m = m_get(); if (!m) { - return -1; + goto out; } memset(m->m_data, 0, m->m_size); @@ -207,9 +205,8 @@ static int tftp_send_error(struct tftp_session *spt, udp_output2(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY); +out: tftp_session_terminate(spt); - - return 0; } static int tftp_send_data(struct tftp_session *spt, |