diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-13 13:43:18 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:23 -0400 |
commit | 88c7664f13bd1a36acb8566b93892a4c58759ac6 (patch) | |
tree | 18ead610bf54ef87f3832c61d64a4bad30d4f78e | |
parent | 4bedb45203eab92a87b4c863fe2d0cded633427f (diff) |
[SK_BUFF]: Introduce icmp_hdr(), remove skb->h.icmph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/icmp.h | 9 | ||||
-rw-r--r-- | include/linux/skbuff.h | 1 | ||||
-rw-r--r-- | net/dccp/ipv4.c | 4 | ||||
-rw-r--r-- | net/ipv4/ah4.c | 4 | ||||
-rw-r--r-- | net/ipv4/esp4.c | 4 | ||||
-rw-r--r-- | net/ipv4/icmp.c | 14 | ||||
-rw-r--r-- | net/ipv4/ip_gre.c | 12 | ||||
-rw-r--r-- | net/ipv4/ip_sockglue.c | 6 | ||||
-rw-r--r-- | net/ipv4/ipcomp.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 12 | ||||
-rw-r--r-- | net/ipv4/raw.c | 6 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 4 | ||||
-rw-r--r-- | net/ipv4/udp.c | 4 | ||||
-rw-r--r-- | net/ipv6/sit.c | 12 | ||||
-rw-r--r-- | net/sctp/input.c | 4 |
15 files changed, 54 insertions, 46 deletions
diff --git a/include/linux/icmp.h b/include/linux/icmp.h index 24da4fbc1a2f..cd3017a15789 100644 --- a/include/linux/icmp.h +++ b/include/linux/icmp.h | |||
@@ -82,6 +82,15 @@ struct icmphdr { | |||
82 | } un; | 82 | } un; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | #ifdef __KERNEL__ | ||
86 | #include <linux/skbuff.h> | ||
87 | |||
88 | static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb) | ||
89 | { | ||
90 | return (struct icmphdr *)skb->h.raw; | ||
91 | } | ||
92 | #endif | ||
93 | |||
85 | /* | 94 | /* |
86 | * constants for (set|get)sockopt | 95 | * constants for (set|get)sockopt |
87 | */ | 96 | */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index cb1ac48cc808..e580416de78a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -238,7 +238,6 @@ struct sk_buff { | |||
238 | 238 | ||
239 | union { | 239 | union { |
240 | struct tcphdr *th; | 240 | struct tcphdr *th; |
241 | struct icmphdr *icmph; | ||
242 | struct iphdr *ipiph; | 241 | struct iphdr *ipiph; |
243 | struct ipv6hdr *ipv6h; | 242 | struct ipv6hdr *ipv6h; |
244 | unsigned char *raw; | 243 | unsigned char *raw; |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index b85437dae0e7..718f2fa923a1 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -207,8 +207,8 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) | |||
207 | (iph->ihl << 2)); | 207 | (iph->ihl << 2)); |
208 | struct dccp_sock *dp; | 208 | struct dccp_sock *dp; |
209 | struct inet_sock *inet; | 209 | struct inet_sock *inet; |
210 | const int type = skb->h.icmph->type; | 210 | const int type = icmp_hdr(skb)->type; |
211 | const int code = skb->h.icmph->code; | 211 | const int code = icmp_hdr(skb)->code; |
212 | struct sock *sk; | 212 | struct sock *sk; |
213 | __u64 seq; | 213 | __u64 seq; |
214 | int err; | 214 | int err; |
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index ebcc797e1c13..e1bb9e0aa5f3 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
@@ -198,8 +198,8 @@ static void ah4_err(struct sk_buff *skb, u32 info) | |||
198 | struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+(iph->ihl<<2)); | 198 | struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+(iph->ihl<<2)); |
199 | struct xfrm_state *x; | 199 | struct xfrm_state *x; |
200 | 200 | ||
201 | if (skb->h.icmph->type != ICMP_DEST_UNREACH || | 201 | if (icmp_hdr(skb)->type != ICMP_DEST_UNREACH || |
202 | skb->h.icmph->code != ICMP_FRAG_NEEDED) | 202 | icmp_hdr(skb)->code != ICMP_FRAG_NEEDED) |
203 | return; | 203 | return; |
204 | 204 | ||
205 | x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET); | 205 | x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET); |
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 82543eebfa52..de019f9fbfe1 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
@@ -304,8 +304,8 @@ static void esp4_err(struct sk_buff *skb, u32 info) | |||
304 | struct ip_esp_hdr *esph = (struct ip_esp_hdr*)(skb->data+(iph->ihl<<2)); | 304 | struct ip_esp_hdr *esph = (struct ip_esp_hdr*)(skb->data+(iph->ihl<<2)); |
305 | struct xfrm_state *x; | 305 | struct xfrm_state *x; |
306 | 306 | ||
307 | if (skb->h.icmph->type != ICMP_DEST_UNREACH || | 307 | if (icmp_hdr(skb)->type != ICMP_DEST_UNREACH || |
308 | skb->h.icmph->code != ICMP_FRAG_NEEDED) | 308 | icmp_hdr(skb)->code != ICMP_FRAG_NEEDED) |
309 | return; | 309 | return; |
310 | 310 | ||
311 | x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, esph->spi, IPPROTO_ESP, AF_INET); | 311 | x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, esph->spi, IPPROTO_ESP, AF_INET); |
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 4d70c21c50aa..8372f8b8f0cd 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -355,7 +355,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, | |||
355 | ipc, rt, MSG_DONTWAIT) < 0) | 355 | ipc, rt, MSG_DONTWAIT) < 0) |
356 | ip_flush_pending_frames(icmp_socket->sk); | 356 | ip_flush_pending_frames(icmp_socket->sk); |
357 | else if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { | 357 | else if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { |
358 | struct icmphdr *icmph = skb->h.icmph; | 358 | struct icmphdr *icmph = icmp_hdr(skb); |
359 | __wsum csum = 0; | 359 | __wsum csum = 0; |
360 | struct sk_buff *skb1; | 360 | struct sk_buff *skb1; |
361 | 361 | ||
@@ -613,7 +613,7 @@ static void icmp_unreach(struct sk_buff *skb) | |||
613 | if (!pskb_may_pull(skb, sizeof(struct iphdr))) | 613 | if (!pskb_may_pull(skb, sizeof(struct iphdr))) |
614 | goto out_err; | 614 | goto out_err; |
615 | 615 | ||
616 | icmph = skb->h.icmph; | 616 | icmph = icmp_hdr(skb); |
617 | iph = (struct iphdr *)skb->data; | 617 | iph = (struct iphdr *)skb->data; |
618 | 618 | ||
619 | if (iph->ihl < 5) /* Mangled header, drop. */ | 619 | if (iph->ihl < 5) /* Mangled header, drop. */ |
@@ -743,7 +743,7 @@ static void icmp_redirect(struct sk_buff *skb) | |||
743 | 743 | ||
744 | iph = (struct iphdr *)skb->data; | 744 | iph = (struct iphdr *)skb->data; |
745 | 745 | ||
746 | switch (skb->h.icmph->code & 7) { | 746 | switch (icmp_hdr(skb)->code & 7) { |
747 | case ICMP_REDIR_NET: | 747 | case ICMP_REDIR_NET: |
748 | case ICMP_REDIR_NETTOS: | 748 | case ICMP_REDIR_NETTOS: |
749 | /* | 749 | /* |
@@ -752,7 +752,7 @@ static void icmp_redirect(struct sk_buff *skb) | |||
752 | case ICMP_REDIR_HOST: | 752 | case ICMP_REDIR_HOST: |
753 | case ICMP_REDIR_HOSTTOS: | 753 | case ICMP_REDIR_HOSTTOS: |
754 | ip_rt_redirect(ip_hdr(skb)->saddr, iph->daddr, | 754 | ip_rt_redirect(ip_hdr(skb)->saddr, iph->daddr, |
755 | skb->h.icmph->un.gateway, | 755 | icmp_hdr(skb)->un.gateway, |
756 | iph->saddr, skb->dev); | 756 | iph->saddr, skb->dev); |
757 | break; | 757 | break; |
758 | } | 758 | } |
@@ -780,7 +780,7 @@ static void icmp_echo(struct sk_buff *skb) | |||
780 | if (!sysctl_icmp_echo_ignore_all) { | 780 | if (!sysctl_icmp_echo_ignore_all) { |
781 | struct icmp_bxm icmp_param; | 781 | struct icmp_bxm icmp_param; |
782 | 782 | ||
783 | icmp_param.data.icmph = *skb->h.icmph; | 783 | icmp_param.data.icmph = *icmp_hdr(skb); |
784 | icmp_param.data.icmph.type = ICMP_ECHOREPLY; | 784 | icmp_param.data.icmph.type = ICMP_ECHOREPLY; |
785 | icmp_param.skb = skb; | 785 | icmp_param.skb = skb; |
786 | icmp_param.offset = 0; | 786 | icmp_param.offset = 0; |
@@ -816,7 +816,7 @@ static void icmp_timestamp(struct sk_buff *skb) | |||
816 | icmp_param.data.times[2] = icmp_param.data.times[1]; | 816 | icmp_param.data.times[2] = icmp_param.data.times[1]; |
817 | if (skb_copy_bits(skb, 0, &icmp_param.data.times[0], 4)) | 817 | if (skb_copy_bits(skb, 0, &icmp_param.data.times[0], 4)) |
818 | BUG(); | 818 | BUG(); |
819 | icmp_param.data.icmph = *skb->h.icmph; | 819 | icmp_param.data.icmph = *icmp_hdr(skb); |
820 | icmp_param.data.icmph.type = ICMP_TIMESTAMPREPLY; | 820 | icmp_param.data.icmph.type = ICMP_TIMESTAMPREPLY; |
821 | icmp_param.data.icmph.code = 0; | 821 | icmp_param.data.icmph.code = 0; |
822 | icmp_param.skb = skb; | 822 | icmp_param.skb = skb; |
@@ -943,7 +943,7 @@ int icmp_rcv(struct sk_buff *skb) | |||
943 | if (!pskb_pull(skb, sizeof(struct icmphdr))) | 943 | if (!pskb_pull(skb, sizeof(struct icmphdr))) |
944 | goto error; | 944 | goto error; |
945 | 945 | ||
946 | icmph = skb->h.icmph; | 946 | icmph = icmp_hdr(skb); |
947 | 947 | ||
948 | /* | 948 | /* |
949 | * 18 is the highest 'known' ICMP type. Anything else is a mystery | 949 | * 18 is the highest 'known' ICMP type. Anything else is a mystery |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 969fe31723a7..39216e6a59ed 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -320,8 +320,8 @@ static void ipgre_err(struct sk_buff *skb, u32 info) | |||
320 | struct iphdr *iph = (struct iphdr*)skb->data; | 320 | struct iphdr *iph = (struct iphdr*)skb->data; |
321 | __be16 *p = (__be16*)(skb->data+(iph->ihl<<2)); | 321 | __be16 *p = (__be16*)(skb->data+(iph->ihl<<2)); |
322 | int grehlen = (iph->ihl<<2) + 4; | 322 | int grehlen = (iph->ihl<<2) + 4; |
323 | int type = skb->h.icmph->type; | 323 | const int type = icmp_hdr(skb)->type; |
324 | int code = skb->h.icmph->code; | 324 | const int code = icmp_hdr(skb)->code; |
325 | struct ip_tunnel *t; | 325 | struct ip_tunnel *t; |
326 | __be16 flags; | 326 | __be16 flags; |
327 | 327 | ||
@@ -388,8 +388,8 @@ out: | |||
388 | struct iphdr *iph = (struct iphdr*)dp; | 388 | struct iphdr *iph = (struct iphdr*)dp; |
389 | struct iphdr *eiph; | 389 | struct iphdr *eiph; |
390 | __be16 *p = (__be16*)(dp+(iph->ihl<<2)); | 390 | __be16 *p = (__be16*)(dp+(iph->ihl<<2)); |
391 | int type = skb->h.icmph->type; | 391 | const int type = icmp_hdr(skb)->type; |
392 | int code = skb->h.icmph->code; | 392 | const int code = icmp_hdr(skb)->code; |
393 | int rel_type = 0; | 393 | int rel_type = 0; |
394 | int rel_code = 0; | 394 | int rel_code = 0; |
395 | __be32 rel_info = 0; | 395 | __be32 rel_info = 0; |
@@ -422,7 +422,7 @@ out: | |||
422 | default: | 422 | default: |
423 | return; | 423 | return; |
424 | case ICMP_PARAMETERPROB: | 424 | case ICMP_PARAMETERPROB: |
425 | n = ntohl(skb->h.icmph->un.gateway) >> 24; | 425 | n = ntohl(icmp_hdr(skb)->un.gateway) >> 24; |
426 | if (n < (iph->ihl<<2)) | 426 | if (n < (iph->ihl<<2)) |
427 | return; | 427 | return; |
428 | 428 | ||
@@ -442,7 +442,7 @@ out: | |||
442 | return; | 442 | return; |
443 | case ICMP_FRAG_NEEDED: | 443 | case ICMP_FRAG_NEEDED: |
444 | /* And it is the only really necessary thing :-) */ | 444 | /* And it is the only really necessary thing :-) */ |
445 | n = ntohs(skb->h.icmph->un.frag.mtu); | 445 | n = ntohs(icmp_hdr(skb)->un.frag.mtu); |
446 | if (n < grehlen+68) | 446 | if (n < grehlen+68) |
447 | return; | 447 | return; |
448 | n -= grehlen; | 448 | n -= grehlen; |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index fabc250e16dd..ccdc59df015f 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -269,12 +269,12 @@ void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | |||
269 | serr = SKB_EXT_ERR(skb); | 269 | serr = SKB_EXT_ERR(skb); |
270 | serr->ee.ee_errno = err; | 270 | serr->ee.ee_errno = err; |
271 | serr->ee.ee_origin = SO_EE_ORIGIN_ICMP; | 271 | serr->ee.ee_origin = SO_EE_ORIGIN_ICMP; |
272 | serr->ee.ee_type = skb->h.icmph->type; | 272 | serr->ee.ee_type = icmp_hdr(skb)->type; |
273 | serr->ee.ee_code = skb->h.icmph->code; | 273 | serr->ee.ee_code = icmp_hdr(skb)->code; |
274 | serr->ee.ee_pad = 0; | 274 | serr->ee.ee_pad = 0; |
275 | serr->ee.ee_info = info; | 275 | serr->ee.ee_info = info; |
276 | serr->ee.ee_data = 0; | 276 | serr->ee.ee_data = 0; |
277 | serr->addr_offset = (u8 *)&(((struct iphdr *)(skb->h.icmph + 1))->daddr) - | 277 | serr->addr_offset = (u8 *)&(((struct iphdr *)(icmp_hdr(skb) + 1))->daddr) - |
278 | skb_network_header(skb); | 278 | skb_network_header(skb); |
279 | serr->port = port; | 279 | serr->port = port; |
280 | 280 | ||
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index 8eb46064c525..1f13cc507a47 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
@@ -174,8 +174,8 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info) | |||
174 | struct ip_comp_hdr *ipch = (struct ip_comp_hdr *)(skb->data+(iph->ihl<<2)); | 174 | struct ip_comp_hdr *ipch = (struct ip_comp_hdr *)(skb->data+(iph->ihl<<2)); |
175 | struct xfrm_state *x; | 175 | struct xfrm_state *x; |
176 | 176 | ||
177 | if (skb->h.icmph->type != ICMP_DEST_UNREACH || | 177 | if (icmp_hdr(skb)->type != ICMP_DEST_UNREACH || |
178 | skb->h.icmph->code != ICMP_FRAG_NEEDED) | 178 | icmp_hdr(skb)->code != ICMP_FRAG_NEEDED) |
179 | return; | 179 | return; |
180 | 180 | ||
181 | spi = htonl(ntohs(ipch->cpi)); | 181 | spi = htonl(ntohs(ipch->cpi)); |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index b7f6ff4705b0..b32b50114806 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -280,8 +280,8 @@ static int ipip_err(struct sk_buff *skb, u32 info) | |||
280 | ICMP in the real Internet is absolutely infeasible. | 280 | ICMP in the real Internet is absolutely infeasible. |
281 | */ | 281 | */ |
282 | struct iphdr *iph = (struct iphdr*)skb->data; | 282 | struct iphdr *iph = (struct iphdr*)skb->data; |
283 | int type = skb->h.icmph->type; | 283 | const int type = icmp_hdr(skb)->type; |
284 | int code = skb->h.icmph->code; | 284 | const int code = icmp_hdr(skb)->code; |
285 | struct ip_tunnel *t; | 285 | struct ip_tunnel *t; |
286 | int err; | 286 | int err; |
287 | 287 | ||
@@ -336,8 +336,8 @@ out: | |||
336 | struct iphdr *iph = (struct iphdr*)dp; | 336 | struct iphdr *iph = (struct iphdr*)dp; |
337 | int hlen = iph->ihl<<2; | 337 | int hlen = iph->ihl<<2; |
338 | struct iphdr *eiph; | 338 | struct iphdr *eiph; |
339 | int type = skb->h.icmph->type; | 339 | const int type = icmp_hdr(skb)->type; |
340 | int code = skb->h.icmph->code; | 340 | const int code = icmp_hdr(skb)->code; |
341 | int rel_type = 0; | 341 | int rel_type = 0; |
342 | int rel_code = 0; | 342 | int rel_code = 0; |
343 | __be32 rel_info = 0; | 343 | __be32 rel_info = 0; |
@@ -354,7 +354,7 @@ out: | |||
354 | default: | 354 | default: |
355 | return 0; | 355 | return 0; |
356 | case ICMP_PARAMETERPROB: | 356 | case ICMP_PARAMETERPROB: |
357 | n = ntohl(skb->h.icmph->un.gateway) >> 24; | 357 | n = ntohl(icmp_hdr(skb)->un.gateway) >> 24; |
358 | if (n < hlen) | 358 | if (n < hlen) |
359 | return 0; | 359 | return 0; |
360 | 360 | ||
@@ -373,7 +373,7 @@ out: | |||
373 | return 0; | 373 | return 0; |
374 | case ICMP_FRAG_NEEDED: | 374 | case ICMP_FRAG_NEEDED: |
375 | /* And it is the only really necessary thing :-) */ | 375 | /* And it is the only really necessary thing :-) */ |
376 | n = ntohs(skb->h.icmph->un.frag.mtu); | 376 | n = ntohs(icmp_hdr(skb)->un.frag.mtu); |
377 | if (n < hlen+68) | 377 | if (n < hlen+68) |
378 | return 0; | 378 | return 0; |
379 | n -= hlen; | 379 | n -= hlen; |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index ac57afa7c316..bf101dc1a972 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -132,7 +132,7 @@ static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb) | |||
132 | if (!pskb_may_pull(skb, sizeof(struct icmphdr))) | 132 | if (!pskb_may_pull(skb, sizeof(struct icmphdr))) |
133 | return 1; | 133 | return 1; |
134 | 134 | ||
135 | type = skb->h.icmph->type; | 135 | type = icmp_hdr(skb)->type; |
136 | if (type < 32) { | 136 | if (type < 32) { |
137 | __u32 data = raw_sk(sk)->filter.data; | 137 | __u32 data = raw_sk(sk)->filter.data; |
138 | 138 | ||
@@ -184,8 +184,8 @@ out: | |||
184 | void raw_err (struct sock *sk, struct sk_buff *skb, u32 info) | 184 | void raw_err (struct sock *sk, struct sk_buff *skb, u32 info) |
185 | { | 185 | { |
186 | struct inet_sock *inet = inet_sk(sk); | 186 | struct inet_sock *inet = inet_sk(sk); |
187 | int type = skb->h.icmph->type; | 187 | const int type = icmp_hdr(skb)->type; |
188 | int code = skb->h.icmph->code; | 188 | const int code = icmp_hdr(skb)->code; |
189 | int err = 0; | 189 | int err = 0; |
190 | int harderr = 0; | 190 | int harderr = 0; |
191 | 191 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 3a86d6b887ac..51424df9078e 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -354,8 +354,8 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) | |||
354 | struct tcphdr *th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); | 354 | struct tcphdr *th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); |
355 | struct tcp_sock *tp; | 355 | struct tcp_sock *tp; |
356 | struct inet_sock *inet; | 356 | struct inet_sock *inet; |
357 | int type = skb->h.icmph->type; | 357 | const int type = icmp_hdr(skb)->type; |
358 | int code = skb->h.icmph->code; | 358 | const int code = icmp_hdr(skb)->code; |
359 | struct sock *sk; | 359 | struct sock *sk; |
360 | __u32 seq; | 360 | __u32 seq; |
361 | int err; | 361 | int err; |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 926404c5e58c..71b0b60ba538 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -330,8 +330,8 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct hlist_head udptable[]) | |||
330 | struct inet_sock *inet; | 330 | struct inet_sock *inet; |
331 | struct iphdr *iph = (struct iphdr*)skb->data; | 331 | struct iphdr *iph = (struct iphdr*)skb->data; |
332 | struct udphdr *uh = (struct udphdr*)(skb->data+(iph->ihl<<2)); | 332 | struct udphdr *uh = (struct udphdr*)(skb->data+(iph->ihl<<2)); |
333 | int type = skb->h.icmph->type; | 333 | const int type = icmp_hdr(skb)->type; |
334 | int code = skb->h.icmph->code; | 334 | const int code = icmp_hdr(skb)->code; |
335 | struct sock *sk; | 335 | struct sock *sk; |
336 | int harderr; | 336 | int harderr; |
337 | int err; | 337 | int err; |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 18ec86f177d9..1e8827b90aa7 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -224,8 +224,8 @@ static int ipip6_err(struct sk_buff *skb, u32 info) | |||
224 | ICMP in the real Internet is absolutely infeasible. | 224 | ICMP in the real Internet is absolutely infeasible. |
225 | */ | 225 | */ |
226 | struct iphdr *iph = (struct iphdr*)skb->data; | 226 | struct iphdr *iph = (struct iphdr*)skb->data; |
227 | int type = skb->h.icmph->type; | 227 | const int type = icmp_hdr(skb)->type; |
228 | int code = skb->h.icmph->code; | 228 | const int code = icmp_hdr(skb)->code; |
229 | struct ip_tunnel *t; | 229 | struct ip_tunnel *t; |
230 | int err; | 230 | int err; |
231 | 231 | ||
@@ -280,8 +280,8 @@ out: | |||
280 | struct iphdr *iph = (struct iphdr*)dp; | 280 | struct iphdr *iph = (struct iphdr*)dp; |
281 | int hlen = iph->ihl<<2; | 281 | int hlen = iph->ihl<<2; |
282 | struct ipv6hdr *iph6; | 282 | struct ipv6hdr *iph6; |
283 | int type = skb->h.icmph->type; | 283 | const int type = icmp_hdr(skb)->type; |
284 | int code = skb->h.icmph->code; | 284 | const int code = icmp_hdr(skb)->code; |
285 | int rel_type = 0; | 285 | int rel_type = 0; |
286 | int rel_code = 0; | 286 | int rel_code = 0; |
287 | int rel_info = 0; | 287 | int rel_info = 0; |
@@ -296,14 +296,14 @@ out: | |||
296 | default: | 296 | default: |
297 | return; | 297 | return; |
298 | case ICMP_PARAMETERPROB: | 298 | case ICMP_PARAMETERPROB: |
299 | if (skb->h.icmph->un.gateway < hlen) | 299 | if (icmp_hdr(skb)->un.gateway < hlen) |
300 | return; | 300 | return; |
301 | 301 | ||
302 | /* So... This guy found something strange INSIDE encapsulated | 302 | /* So... This guy found something strange INSIDE encapsulated |
303 | packet. Well, he is fool, but what can we do ? | 303 | packet. Well, he is fool, but what can we do ? |
304 | */ | 304 | */ |
305 | rel_type = ICMPV6_PARAMPROB; | 305 | rel_type = ICMPV6_PARAMPROB; |
306 | rel_info = skb->h.icmph->un.gateway - hlen; | 306 | rel_info = icmp_hdr(skb)->un.gateway - hlen; |
307 | break; | 307 | break; |
308 | 308 | ||
309 | case ICMP_DEST_UNREACH: | 309 | case ICMP_DEST_UNREACH: |
diff --git a/net/sctp/input.c b/net/sctp/input.c index 3a322c584c74..40d0df80183f 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -507,8 +507,8 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info) | |||
507 | { | 507 | { |
508 | struct iphdr *iph = (struct iphdr *)skb->data; | 508 | struct iphdr *iph = (struct iphdr *)skb->data; |
509 | struct sctphdr *sh = (struct sctphdr *)(skb->data + (iph->ihl <<2)); | 509 | struct sctphdr *sh = (struct sctphdr *)(skb->data + (iph->ihl <<2)); |
510 | int type = skb->h.icmph->type; | 510 | const int type = icmp_hdr(skb)->type; |
511 | int code = skb->h.icmph->code; | 511 | const int code = icmp_hdr(skb)->code; |
512 | struct sock *sk; | 512 | struct sock *sk; |
513 | struct sctp_association *asoc = NULL; | 513 | struct sctp_association *asoc = NULL; |
514 | struct sctp_transport *transport; | 514 | struct sctp_transport *transport; |