diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-14 23:51:49 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:22:50 -0500 |
commit | 714e85be3557222bc25f69c252326207c900a7db (patch) | |
tree | cb59a6d0a94245dc8575507386af1be31dd7fad9 /include | |
parent | 252e33467a3b016f20dd8df12269cef3b167f21e (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')
-rw-r--r-- | include/linux/inetdevice.h | 14 | ||||
-rw-r--r-- | include/net/arp.h | 2 | ||||
-rw-r--r-- | include/net/ip.h | 11 |
3 files changed, 15 insertions, 12 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 | ||
127 | static __inline__ int bad_mask(u32 mask, u32 addr) | 127 | static __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 | ||
193 | static __inline__ int inet_mask_len(__u32 mask) | 194 | static __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 | ||
diff --git a/include/net/arp.h b/include/net/arp.h index 6a3d9a7d302b..f02664568600 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
@@ -16,7 +16,7 @@ extern void arp_send(int type, int ptype, __be32 dest_ip, | |||
16 | struct net_device *dev, __be32 src_ip, | 16 | struct net_device *dev, __be32 src_ip, |
17 | unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th); | 17 | unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th); |
18 | extern int arp_bind_neighbour(struct dst_entry *dst); | 18 | extern int arp_bind_neighbour(struct dst_entry *dst); |
19 | extern int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir); | 19 | extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); |
20 | extern void arp_ifdown(struct net_device *dev); | 20 | extern void arp_ifdown(struct net_device *dev); |
21 | 21 | ||
22 | extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | 22 | extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, |
diff --git a/include/net/ip.h b/include/net/ip.h index 949fa8683626..412e8114667d 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -123,7 +123,7 @@ extern int ip4_datagram_connect(struct sock *sk, | |||
123 | * multicast packets. | 123 | * multicast packets. |
124 | */ | 124 | */ |
125 | 125 | ||
126 | static inline void ip_tr_mc_map(u32 addr, char *buf) | 126 | static inline void ip_tr_mc_map(__be32 addr, char *buf) |
127 | { | 127 | { |
128 | buf[0]=0xC0; | 128 | buf[0]=0xC0; |
129 | buf[1]=0x00; | 129 | buf[1]=0x00; |
@@ -238,9 +238,9 @@ static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst | |||
238 | * Map a multicast IP onto multicast MAC for type ethernet. | 238 | * Map a multicast IP onto multicast MAC for type ethernet. |
239 | */ | 239 | */ |
240 | 240 | ||
241 | static inline void ip_eth_mc_map(u32 addr, char *buf) | 241 | static inline void ip_eth_mc_map(__be32 naddr, char *buf) |
242 | { | 242 | { |
243 | addr=ntohl(addr); | 243 | __u32 addr=ntohl(naddr); |
244 | buf[0]=0x01; | 244 | buf[0]=0x01; |
245 | buf[1]=0x00; | 245 | buf[1]=0x00; |
246 | buf[2]=0x5e; | 246 | buf[2]=0x5e; |
@@ -256,13 +256,14 @@ static inline void ip_eth_mc_map(u32 addr, char *buf) | |||
256 | * Leave P_Key as 0 to be filled in by driver. | 256 | * Leave P_Key as 0 to be filled in by driver. |
257 | */ | 257 | */ |
258 | 258 | ||
259 | static inline void ip_ib_mc_map(u32 addr, char *buf) | 259 | static inline void ip_ib_mc_map(__be32 naddr, char *buf) |
260 | { | 260 | { |
261 | __u32 addr; | ||
261 | buf[0] = 0; /* Reserved */ | 262 | buf[0] = 0; /* Reserved */ |
262 | buf[1] = 0xff; /* Multicast QPN */ | 263 | buf[1] = 0xff; /* Multicast QPN */ |
263 | buf[2] = 0xff; | 264 | buf[2] = 0xff; |
264 | buf[3] = 0xff; | 265 | buf[3] = 0xff; |
265 | addr = ntohl(addr); | 266 | addr = ntohl(naddr); |
266 | buf[4] = 0xff; | 267 | buf[4] = 0xff; |
267 | buf[5] = 0x12; /* link local scope */ | 268 | buf[5] = 0x12; /* link local scope */ |
268 | buf[6] = 0x40; /* IPv4 signature */ | 269 | buf[6] = 0x40; /* IPv4 signature */ |