Commit 7f2c2754 authored by David S. Miller's avatar David S. Miller

[IPV6]: Undo __constant_{n,h}to{n,h}l from anycast patch.

parent db08df95
...@@ -179,10 +179,10 @@ int ipv6_addr_type(struct in6_addr *addr) ...@@ -179,10 +179,10 @@ int ipv6_addr_type(struct in6_addr *addr)
st = addr->s6_addr32[0]; st = addr->s6_addr32[0];
if ((st & __constant_htonl(0xFF000000)) == __constant_htonl(0xFF000000)) { if ((st & htonl(0xFF000000)) == htonl(0xFF000000)) {
type = IPV6_ADDR_MULTICAST; type = IPV6_ADDR_MULTICAST;
switch((st & __constant_htonl(0x00FF0000))) { switch((st & htonl(0x00FF0000))) {
case __constant_htonl(0x00010000): case __constant_htonl(0x00010000):
type |= IPV6_ADDR_LOOPBACK; type |= IPV6_ADDR_LOOPBACK;
break; break;
...@@ -199,9 +199,9 @@ int ipv6_addr_type(struct in6_addr *addr) ...@@ -199,9 +199,9 @@ int ipv6_addr_type(struct in6_addr *addr)
} }
/* check for reserved anycast addresses */ /* check for reserved anycast addresses */
if ((st & __constant_htonl(0xE0000000)) && if ((st & htonl(0xE0000000)) &&
((addr->s6_addr32[2] == __constant_htonl(0xFDFFFFFF) && ((addr->s6_addr32[2] == htonl(0xFDFFFFFF) &&
(addr->s6_addr32[3] | __constant_htonl(0x7F)) == (u32)~0) || (addr->s6_addr32[3] | htonl(0x7F)) == (u32)~0) ||
(addr->s6_addr32[2] == 0 && addr->s6_addr32[3] == 0))) (addr->s6_addr32[2] == 0 && addr->s6_addr32[3] == 0)))
type = IPV6_ADDR_ANYCAST; type = IPV6_ADDR_ANYCAST;
else else
...@@ -210,14 +210,14 @@ int ipv6_addr_type(struct in6_addr *addr) ...@@ -210,14 +210,14 @@ int ipv6_addr_type(struct in6_addr *addr)
/* Consider all addresses with the first three bits different of /* Consider all addresses with the first three bits different of
000 and 111 as finished. 000 and 111 as finished.
*/ */
if ((st & __constant_htonl(0xE0000000)) != __constant_htonl(0x00000000) && if ((st & htonl(0xE0000000)) != htonl(0x00000000) &&
(st & __constant_htonl(0xE0000000)) != __constant_htonl(0xE0000000)) (st & htonl(0xE0000000)) != htonl(0xE0000000))
return type; return type;
if ((st & __constant_htonl(0xFFC00000)) == __constant_htonl(0xFE800000)) if ((st & htonl(0xFFC00000)) == htonl(0xFE800000))
return (IPV6_ADDR_LINKLOCAL | type); return (IPV6_ADDR_LINKLOCAL | type);
if ((st & __constant_htonl(0xFFC00000)) == __constant_htonl(0xFEC00000)) if ((st & htonl(0xFFC00000)) == htonl(0xFEC00000))
return (IPV6_ADDR_SITELOCAL | type); return (IPV6_ADDR_SITELOCAL | type);
if ((addr->s6_addr32[0] | addr->s6_addr32[1]) == 0) { if ((addr->s6_addr32[0] | addr->s6_addr32[1]) == 0) {
...@@ -225,23 +225,23 @@ int ipv6_addr_type(struct in6_addr *addr) ...@@ -225,23 +225,23 @@ int ipv6_addr_type(struct in6_addr *addr)
if (addr->in6_u.u6_addr32[3] == 0) if (addr->in6_u.u6_addr32[3] == 0)
return IPV6_ADDR_ANY; return IPV6_ADDR_ANY;
if (addr->s6_addr32[3] == __constant_htonl(0x00000001)) if (addr->s6_addr32[3] == htonl(0x00000001))
return (IPV6_ADDR_LOOPBACK | type); return (IPV6_ADDR_LOOPBACK | type);
return (IPV6_ADDR_COMPATv4 | type); return (IPV6_ADDR_COMPATv4 | type);
} }
if (addr->s6_addr32[2] == __constant_htonl(0x0000ffff)) if (addr->s6_addr32[2] == htonl(0x0000ffff))
return IPV6_ADDR_MAPPED; return IPV6_ADDR_MAPPED;
} }
st &= __constant_htonl(0xFF000000); st &= htonl(0xFF000000);
if (st == 0) if (st == 0)
return IPV6_ADDR_RESERVED; return IPV6_ADDR_RESERVED;
st &= __constant_htonl(0xFE000000); st &= htonl(0xFE000000);
if (st == __constant_htonl(0x02000000)) if (st == htonl(0x02000000))
return IPV6_ADDR_RESERVED; /* for NSAP */ return IPV6_ADDR_RESERVED; /* for NSAP */
if (st == __constant_htonl(0x04000000)) if (st == htonl(0x04000000))
return IPV6_ADDR_RESERVED; /* for IPX */ return IPV6_ADDR_RESERVED; /* for IPX */
return type; return type;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment