summaryrefslogtreecommitdiff
path: root/Utilities/cmcurl/lib/tftp.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-02-21 10:01:04 -0500
committerBrad King <brad.king@kitware.com>2023-02-21 10:04:36 -0500
commitce1550f1783ba7ca981468621da4bc33d065b508 (patch)
treed66a86859605f70063f161d00fe7f61e5ffb32f5 /Utilities/cmcurl/lib/tftp.c
parent37cceabc6531884045c88c2b461f7e9a7054edd2 (diff)
parent11ba4361aaecf2f1f82ef841146c4c90173d2aca (diff)
downloadcmake-ce1550f1783ba7ca981468621da4bc33d065b508.tar.gz
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2023-02-20 (046209e5)
Diffstat (limited to 'Utilities/cmcurl/lib/tftp.c')
-rw-r--r--Utilities/cmcurl/lib/tftp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Utilities/cmcurl/lib/tftp.c b/Utilities/cmcurl/lib/tftp.c
index 9e6d9490ed..164d3c723c 100644
--- a/Utilities/cmcurl/lib/tftp.c
+++ b/Utilities/cmcurl/lib/tftp.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -48,6 +48,7 @@
#include "urldata.h"
#include <curl/curl.h>
+#include "cf-socket.h"
#include "transfer.h"
#include "sendf.h"
#include "tftp.h"
@@ -529,8 +530,8 @@ static CURLcode tftp_send_first(struct tftp_state_data *state,
not have a size_t argument, like older unixes that want an 'int' */
senddata = sendto(state->sockfd, (void *)state->spacket.data,
(SEND_TYPE_ARG3)sbytes, 0,
- data->conn->ip_addr->ai_addr,
- data->conn->ip_addr->ai_addrlen);
+ &data->conn->remote_addr->sa_addr,
+ data->conn->remote_addr->addrlen);
if(senddata != (ssize_t)sbytes) {
char buffer[STRERROR_LEN];
failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer)));
@@ -1014,7 +1015,7 @@ static CURLcode tftp_connect(struct Curl_easy *data, bool *done)
state->requested_blksize = blksize;
((struct sockaddr *)&state->local_addr)->sa_family =
- (CURL_SA_FAMILY_T)(conn->ip_addr->ai_family);
+ (CURL_SA_FAMILY_T)(conn->remote_addr->family);
tftp_set_timeouts(state);
@@ -1033,7 +1034,7 @@ static CURLcode tftp_connect(struct Curl_easy *data, bool *done)
* IPv4 and IPv6...
*/
int rc = bind(state->sockfd, (struct sockaddr *)&state->local_addr,
- conn->ip_addr->ai_addrlen);
+ conn->remote_addr->addrlen);
if(rc) {
char buffer[STRERROR_LEN];
failf(data, "bind() failed; %s",