TFTP: resend the correct data
authorRutger Hofman <rutger@cs.vu.nl>
Wed, 10 Nov 2010 14:08:18 +0000 (15:08 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 10 Nov 2010 14:08:18 +0000 (15:08 +0100)
I found a bug in tftp_tx() in tftp.c. If a data resend is done after
reception of an ACK/OACK, the call to sendto is wrong.

lib/tftp.c

index 782bb73..46ed2a7 100644 (file)
@@ -738,7 +738,7 @@ static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
         }
         else {
           /* Re-send the data packet */
-          sbytes = sendto(state->sockfd, (void *)&state->spacket,
+          sbytes = sendto(state->sockfd, (void *)&state->spacket.data,
                           4+state->sbytes, SEND_4TH_ARG,
                           (struct sockaddr *)&state->remote_addr,
                           state->remote_addrlen);