|
|
@ -304,12 +304,12 @@ static bool process_serverlist(const grpc_grpclb_server *server, |
|
|
|
memcpy(&addr4->sin_addr, ip->bytes, ip->size); |
|
|
|
memcpy(&addr4->sin_addr, ip->bytes, ip->size); |
|
|
|
addr4->sin_port = netorder_port; |
|
|
|
addr4->sin_port = netorder_port; |
|
|
|
} else if (ip->size == 6) { |
|
|
|
} else if (ip->size == 6) { |
|
|
|
struct sockaddr_in *addr6 = (struct sockaddr_in *)sa; |
|
|
|
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)sa; |
|
|
|
*sa_len = sizeof(struct sockaddr_in); |
|
|
|
*sa_len = sizeof(struct sockaddr_in6); |
|
|
|
memset(addr6, 0, *sa_len); |
|
|
|
memset(addr6, 0, *sa_len); |
|
|
|
addr6->sin_family = AF_INET; |
|
|
|
addr6->sin6_family = AF_INET; |
|
|
|
memcpy(&addr6->sin_addr, ip->bytes, ip->size); |
|
|
|
memcpy(&addr6->sin6_addr, ip->bytes, ip->size); |
|
|
|
addr6->sin_port = netorder_port; |
|
|
|
addr6->sin6_port = netorder_port; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
gpr_log(GPR_ERROR, "Expected IP to be 4 or 16 bytes. Got %d.", ip->size); |
|
|
|
gpr_log(GPR_ERROR, "Expected IP to be 4 or 16 bytes. Got %d.", ip->size); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|