aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-14 23:51:49 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:22:50 -0500
commit714e85be3557222bc25f69c252326207c900a7db (patch)
treecb59a6d0a94245dc8575507386af1be31dd7fad9 /include/linux
parent252e33467a3b016f20dd8df12269cef3b167f21e (diff)
[IPV6]: Assorted trivial endianness annotations.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/inetdevice.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 5a0ab04627bc..c0f7aec331c2 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -124,12 +124,13 @@ static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
124 * Check if a mask is acceptable. 124 * Check if a mask is acceptable.
125 */ 125 */
126 126
127static __inline__ int bad_mask(u32 mask, u32 addr) 127static __inline__ int bad_mask(__be32 mask, __be32 addr)
128{ 128{
129 __u32 hmask;
129 if (addr & (mask = ~mask)) 130 if (addr & (mask = ~mask))
130 return 1; 131 return 1;
131 mask = ntohl(mask); 132 hmask = ntohl(mask);
132 if (mask & (mask+1)) 133 if (hmask & (hmask+1))
133 return 1; 134 return 1;
134 return 0; 135 return 0;
135} 136}
@@ -190,11 +191,12 @@ static __inline__ __be32 inet_make_mask(int logmask)
190 return 0; 191 return 0;
191} 192}
192 193
193static __inline__ int inet_mask_len(__u32 mask) 194static __inline__ int inet_mask_len(__be32 mask)
194{ 195{
195 if (!(mask = ntohl(mask))) 196 __u32 hmask = ntohl(mask);
197 if (!hmask)
196 return 0; 198 return 0;
197 return 32 - ffz(~mask); 199 return 32 - ffz(~hmask);
198} 200}
199 201
200 202