diff options
author | Alexander Polcyn <apolcyn@google.com> | 2017-03-09 14:18:27 -0800 |
---|---|---|
committer | Alexander Polcyn <apolcyn@google.com> | 2017-03-09 14:18:27 -0800 |
commit | 648229ec976ed89d5713f689cf0c2f433cecb806 (patch) | |
tree | 8eb8e01d02da18df042d44ad07798fe6953f50c5 /src/core | |
parent | eb064ec7b81b60c5e1eb47d6124d0c05056b3097 (diff) |
fix in6_scope_id incompatibiliity issue on windows/mingw
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ext/client_channel/parse_address.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/ext/client_channel/parse_address.c b/src/core/ext/client_channel/parse_address.c index 8ae15fc72b..cd1b2cd80c 100644 --- a/src/core/ext/client_channel/parse_address.c +++ b/src/core/ext/client_channel/parse_address.c @@ -128,6 +128,7 @@ int parse_ipv6(grpc_uri *uri, grpc_resolved_address *resolved_addr) { GPR_ASSERT(host_end >= host); char host_without_scope[INET6_ADDRSTRLEN]; size_t host_without_scope_len = (size_t)(host_end - host); + uint32_t sin6_scope_id = 0; strncpy(host_without_scope, host, host_without_scope_len); host_without_scope[host_without_scope_len] = '\0'; if (inet_pton(AF_INET6, host_without_scope, &in6->sin6_addr) == 0) { @@ -136,10 +137,12 @@ int parse_ipv6(grpc_uri *uri, grpc_resolved_address *resolved_addr) { } if (gpr_parse_bytes_to_uint32(host_end + 1, strlen(host) - host_without_scope_len - 1, - &in6->sin6_scope_id) == 0) { + &sin6_scope_id) == 0) { gpr_log(GPR_ERROR, "invalid ipv6 scope id: '%s'", host_end + 1); goto done; } + // Handle "sin6_scope_id" being type "u_long". See grpc issue ##10027. + in6->sin6_scope_id = sin6_scope_id; } else { if (inet_pton(AF_INET6, host, &in6->sin6_addr) == 0) { gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host); |