diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-02-09 03:13:05 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-02-09 03:13:05 +0000 |
commit | fe987d3a1796c91bc6482874896c5912099d6d73 (patch) | |
tree | d0b96e229243e3ec287cb0fed0c4893dce49f68f /src/common/compat.c | |
parent | 2ebdf91a523348aad3eae7dc565510260a374ef4 (diff) | |
download | tor-fe987d3a1796c91bc6482874896c5912099d6d73.tar.gz tor-fe987d3a1796c91bc6482874896c5912099d6d73.zip |
Remove some deadcode and use tor_inet_aton uniformly.
svn:r18422
Diffstat (limited to 'src/common/compat.c')
-rw-r--r-- | src/common/compat.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index ea8cbf97d8..fa6967289d 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -97,12 +97,6 @@ #include "strlcat.c" #endif -#ifndef INADDR_NONE -/* This is used by inet_addr, but apparently Solaris doesn't define it - * anyplace. */ -#define INADDR_NONE ((unsigned long) -1) -#endif - #ifdef HAVE_SYS_MMAN_H /** Try to create a memory mapping for <b>filename</b> and return it. On * failure, return NULL. Sets errno properly, using ERANGE to mean @@ -1274,25 +1268,6 @@ tor_inet_aton(const char *str, struct in_addr* addr) if (d < 0 || d > 255) return 0; addr->s_addr = htonl((a<<24) | (b<<16) | (c<<8) | d); return 1; - -#if 0 -#ifdef HAVE_INET_ATON - return inet_aton(c, addr); -#else - uint32_t r; - tor_assert(c); - tor_assert(addr); - if (strcmp(c, "255.255.255.255") == 0) { - addr->s_addr = 0xFFFFFFFFu; - return 1; - } - r = inet_addr(c); - if (r == INADDR_NONE) - return 0; - addr->s_addr = r; - return 1; -#endif -#endif } /** Given <b>af</b>==AF_INET and <b>src</b> a struct in_addr, or |