diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-07-19 20:47:18 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-07-19 20:47:18 +0000 |
commit | 6223160ab7a5e6d20fcbd7095e4d154d0c1e0316 (patch) | |
tree | e9ba7e9f1b4451ccd16c5689ee1e56c2fe26105b /src/common/compat.c | |
parent | 3015129a4a7a0e981fee3424e2f4e3b2170ef5e7 (diff) | |
download | tor-6223160ab7a5e6d20fcbd7095e4d154d0c1e0316.tar.gz tor-6223160ab7a5e6d20fcbd7095e4d154d0c1e0316.zip |
r13848@catbus: nickm | 2007-07-19 16:47:16 -0400
Use our own version of inet_ntop and inet_pton everywhere, to avoid partitioning attacks.
svn:r10888
Diffstat (limited to 'src/common/compat.c')
-rw-r--r-- | src/common/compat.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 6d68c2daca..b32c0b115c 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -819,9 +819,6 @@ tor_inet_aton(const char *c, struct in_addr* addr) const char * tor_inet_ntop(int af, const void *src, char *dst, size_t len) { -#ifdef HAVE_INET_NTOP - return inet_ntop(af,src,dst,(socklen_t)len); -#else if (af == AF_INET) { if (tor_inet_ntoa(src, dst, len) < 0) return NULL; @@ -896,7 +893,6 @@ tor_inet_ntop(int af, const void *src, char *dst, size_t len) } else { return NULL; } -#endif } /** Given <b>af</b>==AF_INET or <b>af</b>==AF_INET6, and a string <b>src</b> @@ -911,9 +907,6 @@ tor_inet_ntop(int af, const void *src, char *dst, size_t len) int tor_inet_pton(int af, const char *src, void *dst) { -#ifdef HAVE_INET_PTON - return inet_pton(af, src, dst); -#else if (af == AF_INET) { return tor_inet_aton(src, dst); } else if (af == AF_INET6) { @@ -1000,7 +993,6 @@ tor_inet_pton(int af, const char *src, void *dst) } else { return -1; } -#endif } /** Similar behavior to Unix gethostbyname: resolve <b>name</b>, and set |