diff options
Diffstat (limited to 'include/net/ip.h')
-rw-r--r-- | include/net/ip.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index b6d95e553401..83cb9ac5554e 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -97,7 +97,7 @@ extern int ip_mc_output(struct sk_buff *skb); | |||
97 | extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | 97 | extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); |
98 | extern int ip_do_nat(struct sk_buff *skb); | 98 | extern int ip_do_nat(struct sk_buff *skb); |
99 | extern void ip_send_check(struct iphdr *ip); | 99 | extern void ip_send_check(struct iphdr *ip); |
100 | extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); | 100 | extern int ip_queue_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok); |
101 | extern void ip_init(void); | 101 | extern void ip_init(void); |
102 | extern int ip_append_data(struct sock *sk, | 102 | extern int ip_append_data(struct sock *sk, |
103 | int getfrag(void *from, char *to, int offset, int len, | 103 | int getfrag(void *from, char *to, int offset, int len, |
@@ -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; |
@@ -135,7 +135,7 @@ static inline void ip_tr_mc_map(u32 addr, char *buf) | |||
135 | 135 | ||
136 | struct ip_reply_arg { | 136 | struct ip_reply_arg { |
137 | struct kvec iov[1]; | 137 | struct kvec iov[1]; |
138 | u32 csum; | 138 | __wsum csum; |
139 | int csumoffset; /* u16 offset of csum in iov[0].iov_base */ | 139 | int csumoffset; /* u16 offset of csum in iov[0].iov_base */ |
140 | /* -1 if not needed */ | 140 | /* -1 if not needed */ |
141 | }; | 141 | }; |
@@ -192,9 +192,9 @@ extern void ipfrag_init(void); | |||
192 | static inline | 192 | static inline |
193 | int ip_decrease_ttl(struct iphdr *iph) | 193 | int ip_decrease_ttl(struct iphdr *iph) |
194 | { | 194 | { |
195 | u32 check = iph->check; | 195 | u32 check = (__force u32)iph->check; |
196 | check += htons(0x0100); | 196 | check += (__force u32)htons(0x0100); |
197 | iph->check = check + (check>=0xFFFF); | 197 | iph->check = (__force __sum16)(check + (check>=0xFFFF)); |
198 | return --iph->ttl; | 198 | return --iph->ttl; |
199 | } | 199 | } |
200 | 200 | ||
@@ -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 */ |