Commit ef2d54d8df7e4a515b603fe101e73f716d81e778
Committed by
Anthony Liguori
1 parent
f8e3cbd3
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>
Showing
1 changed file
with
5 additions
and
8 deletions
slirp/tftp.c
| ... | ... | @@ -167,11 +167,9 @@ static int tftp_send_oack(struct tftp_session *spt, |
| 167 | 167 | return 0; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - | |
| 171 | - | |
| 172 | -static int tftp_send_error(struct tftp_session *spt, | |
| 173 | - u_int16_t errorcode, const char *msg, | |
| 174 | - struct tftp_t *recv_tp) | |
| 170 | +static void tftp_send_error(struct tftp_session *spt, | |
| 171 | + u_int16_t errorcode, const char *msg, | |
| 172 | + struct tftp_t *recv_tp) | |
| 175 | 173 | { |
| 176 | 174 | struct sockaddr_in saddr, daddr; |
| 177 | 175 | struct mbuf *m; |
| ... | ... | @@ -181,7 +179,7 @@ static int tftp_send_error(struct tftp_session *spt, |
| 181 | 179 | m = m_get(); |
| 182 | 180 | |
| 183 | 181 | if (!m) { |
| 184 | - return -1; | |
| 182 | + goto out; | |
| 185 | 183 | } |
| 186 | 184 | |
| 187 | 185 | memset(m->m_data, 0, m->m_size); |
| ... | ... | @@ -207,9 +205,8 @@ static int tftp_send_error(struct tftp_session *spt, |
| 207 | 205 | |
| 208 | 206 | udp_output2(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY); |
| 209 | 207 | |
| 208 | +out: | |
| 210 | 209 | tftp_session_terminate(spt); |
| 211 | - | |
| 212 | - return 0; | |
| 213 | 210 | } |
| 214 | 211 | |
| 215 | 212 | static int tftp_send_data(struct tftp_session *spt, | ... | ... |