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>
This commit is contained in:
Jan Kiszka 2009-06-24 14:42:30 +02:00 committed by Anthony Liguori
parent f8e3cbd3b5
commit ef2d54d8df
1 changed files with 5 additions and 8 deletions

View File

@ -167,11 +167,9 @@ static int tftp_send_oack(struct tftp_session *spt,
return 0; return 0;
} }
static void tftp_send_error(struct tftp_session *spt,
u_int16_t errorcode, const char *msg,
static int tftp_send_error(struct tftp_session *spt, struct tftp_t *recv_tp)
u_int16_t errorcode, const char *msg,
struct tftp_t *recv_tp)
{ {
struct sockaddr_in saddr, daddr; struct sockaddr_in saddr, daddr;
struct mbuf *m; struct mbuf *m;
@ -181,7 +179,7 @@ static int tftp_send_error(struct tftp_session *spt,
m = m_get(); m = m_get();
if (!m) { if (!m) {
return -1; goto out;
} }
memset(m->m_data, 0, m->m_size); 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); udp_output2(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY);
out:
tftp_session_terminate(spt); tftp_session_terminate(spt);
return 0;
} }
static int tftp_send_data(struct tftp_session *spt, static int tftp_send_data(struct tftp_session *spt,