cURL / Mailing Lists / curl-library / Single Mail

curl-library

AF_UNSPEC and bind()

From: Gisle Vanem <giva_at_bgnett.no>
Date: Fri, 09 Sep 2005 17:32:32 +0200

I commited this change in tftp.c:

@@ -533,12 +535,18 @@
   state->sockfd = state->conn->sock[FIRSTSOCKET];
   state->state = TFTP_STATE_START;
 
+#ifdef WIN32
+ /* AF_UNSPEC == 0 (from above calloc) doesn't work on Winsock */
+ state->local_addr.sa_family = conn->ip_addr->ai_family;
+#endif
+

and wonder if not this should be done for all. I'm not sure why AF_UNSPEC
magically works on Linux (that's where this was tested, no?) and what it
really means.

w/o the above change, I got "Address family not supported" under Winsock
(no surprice).

--gv
Received on 2005-09-09