version 1.74, 2009/01/30 18:18:33
|
version 1.75, 2009/09/16 04:01:59
|
|
|
#ifdef PEGASUS_ENABLE_IPV6 | #ifdef PEGASUS_ENABLE_IPV6 |
struct in6_addr ip6 = PEGASUS_IPV6_LOOPBACK_INIT; | struct in6_addr ip6 = PEGASUS_IPV6_LOOPBACK_INIT; |
#endif | #endif |
Uint32 ip4 = PEGASUS_IPV4_LOOPBACK_INIT; |
|
switch (af) | switch (af) |
{ | { |
#ifdef PEGASUS_ENABLE_IPV6 | #ifdef PEGASUS_ENABLE_IPV6 |
|
|
Uint32 tmp; | Uint32 tmp; |
memcpy(&tmp, binIPAddress, sizeof(Uint32)); | memcpy(&tmp, binIPAddress, sizeof(Uint32)); |
Uint32 n = ntohl(tmp); | Uint32 n = ntohl(tmp); |
return !memcmp(&ip4, &n, sizeof (ip4)); |
return n >= PEGASUS_IPV4_LOOPBACK_RANGE_START && |
|
n <= PEGASUS_IPV4_LOOPBACK_RANGE_END; |
} | } |
} | } |
| |