Your atention, please...
At ACLIP.cc there is a function setting up a order relationship given two
IP addresses/networks...
aclIPaddrNetworkCompare()
struct IN_ADDR A = p-addr1;
const struct IN_ADDR B = q-addr1;
const struct IN_ADDR C = q-addr2;
A.s_addr = q-mask.s_addr;
- I can redefine the address ordering to byte-to-byte comparing (memcmp)
on the two memory areas A B , but on IPv4 and i386 boxes§ they would
invert the actual order, since network order inverts the bytes on host order
(ntohl) , so...
OK. As I see, the only purpose of previous function
On Wed, 25 May 2005, Rafael Martinez Torres wrote:
Index: ACLIP.cc
-if (ntohl(A.s_addr) ntohl(C.s_addr))
+if (memcmp(A, C, sizeof(struct IN_ADDR)) 0)
Hmm.. this has quite different semantics. The original looks at the
addresses in host byte order, while the memcmp looks at
On Wed, 25 May 2005, Rafael Martinez Torres wrote:
NOTES:
--
- Solved the masking on IPv6, I cannot compare 128 bits integers, unless
I define it. (squid128_int_t)
- I can redefine the address ordering to byte-to-byte comparing (memcmp)
on the two memory areas A B , but on IPv4 and i386
On Thu, 26 May 2005, Henrik Nordstrom wrote:
On Wed, 25 May 2005, Rafael Martinez Torres wrote:
Index: ACLIP.cc
-if (ntohl(A.s_addr) ntohl(C.s_addr))
+if (memcmp(A, C, sizeof(struct IN_ADDR)) 0)
Hmm.. this has quite different semantics. The original looks at the