diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-11-04 00:45:14 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-04 00:45:14 -0500 |
commit | 254ab5a8deb9ed5fb571016f402ffd7243208d73 (patch) | |
tree | b8d17ad6ec4a62516b9e7a7d31f40856a727662d /src | |
parent | 51e247361824fa64f4322fb59e9d2cffd9d72cba (diff) | |
download | tor-254ab5a8deb9ed5fb571016f402ffd7243208d73.tar.gz tor-254ab5a8deb9ed5fb571016f402ffd7243208d73.zip |
Use correct argument types for inet_pton.
(I blame whoever decided that using a void* for a union was a good
idea.)
Diffstat (limited to 'src')
-rw-r--r-- | src/common/util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/util.c b/src/common/util.c index c292c798cc..83002997ef 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -963,9 +963,9 @@ string_is_key_value(int severity, const char *string) int string_is_valid_ipv4_address(const char *string) { - struct sockaddr_in sockaddr; + struct in_addr addr; - return (tor_inet_pton(AF_INET,string,&sockaddr) == 1); + return (tor_inet_pton(AF_INET,string,&addr) == 1); } /** Return true if <b>string</b> represents a valid IPv6 address in @@ -974,9 +974,9 @@ string_is_valid_ipv4_address(const char *string) int string_is_valid_ipv6_address(const char *string) { - struct sockaddr_in sockaddr_dummy; + struct in6_addr addr; - return (tor_inet_pton(AF_INET6,string,&sockaddr_dummy) == 1); + return (tor_inet_pton(AF_INET6,string,&addr) == 1); } /** Return true iff <b>string</b> matches a pattern of DNS names |