From: Nick Mathewson Date: Fri, 1 Mar 2013 19:46:34 +0000 (-0500) Subject: Remove the unused addr_mask_cmp_bits X-Git-Tag: tor-0.2.5.1-alpha~288 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6dfa709030935060d22e06aa75032a93bd606328;p=thirdparty%2Ftor.git Remove the unused addr_mask_cmp_bits --- diff --git a/src/common/address.c b/src/common/address.c index 67a11d7fde..69e7f68103 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -1565,32 +1565,6 @@ addr_mask_get_bits(uint32_t mask) return -1; } -/** Compare two addresses a1 and a2 for equality under a - * netmask of mbits bits. Return -1, 0, or 1. - * - * XXXX_IP6 Temporary function to allow masks as bitcounts everywhere. This - * will be replaced with an IPv6-aware version as soon as 32-bit addresses are - * no longer passed around. - */ -int -addr_mask_cmp_bits(uint32_t a1, uint32_t a2, maskbits_t bits) -{ - if (bits > 32) - bits = 32; - else if (bits == 0) - return 0; - - a1 >>= (32-bits); - a2 >>= (32-bits); - - if (a1 < a2) - return -1; - else if (a1 > a2) - return 1; - else - return 0; -} - /** Parse a string s in the format of (*|port(-maxport)?)?, setting the * various *out pointers as appropriate. Return 0 on success, -1 on failure. */ diff --git a/src/common/address.h b/src/common/address.h index ec63257e60..77e5855346 100644 --- a/src/common/address.h +++ b/src/common/address.h @@ -220,7 +220,6 @@ int addr_port_lookup(int severity, const char *addrport, char **address, int parse_port_range(const char *port, uint16_t *port_min_out, uint16_t *port_max_out); int addr_mask_get_bits(uint32_t mask); -int addr_mask_cmp_bits(uint32_t a1, uint32_t a2, maskbits_t bits); /** Length of a buffer to allocate to hold the results of tor_inet_ntoa.*/ #define INET_NTOA_BUF_LEN 16 int tor_inet_ntoa(const struct in_addr *in, char *buf, size_t buf_len);