Commit 0f81fbe5 authored by Kim Vandry's avatar Kim Vandry Committed by Steve Holme
Browse files

ares: Fixed compilation under Visual Studio 2012

parent 9b679604
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -645,10 +645,10 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
                                const char *local_ip4)
{
#if (ARES_VERSION >= 0x010704)
  uint32_t a4;
  struct in_addr a4;

  if((!local_ip4) || (local_ip4[0] == 0)) {
    a4 = 0; /* disabled: do not bind to a specific address */
    a4.s_addr = 0; /* disabled: do not bind to a specific address */
  }
  else {
    if(Curl_inet_pton(AF_INET, local_ip4, &a4) != 1) {
@@ -656,7 +656,7 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
    }
  }

  ares_set_local_ip4((ares_channel)data->state.resolver, ntohl(a4));
  ares_set_local_ip4((ares_channel)data->state.resolver, ntohl(a4.s_addr));

  return CURLE_OK;
#else /* c-ares version too old! */