cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] Fix for tftp

From: Tor Arntsen <tor_at_spacetec.no>
Date: Thu, 23 Mar 2006 16:20:18 +0100

The following patch fixes the bind() problem on Unix (tested on IRIX, AIX
and Tru64) so that tftp works.

-Tor

Index: lib/tftp.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/tftp.c,v
retrieving revision 1.18
diff -u -p -r1.18 tftp.c
--- lib/tftp.c 20 Mar 2006 22:15:22 -0000 1.18
+++ lib/tftp.c 23 Mar 2006 15:17:44 -0000
@@ -566,7 +566,7 @@ CURLcode Curl_tftp_connect(struct connec
 
   /* Bind to any interface, random UDP port */
   rc = bind(state->sockfd, (struct sockaddr *)&state->local_addr,
- sizeof(state->local_addr));
+ sizeof(struct sockaddr_in));
   if(rc) {
     failf(conn->data, "bind() failed; %s\n",
           Curl_strerror(conn,Curl_ourerrno()));
Received on 2006-03-23