diff options
| author | Michal Marek <mmarek@suse.cz> | 2010-10-27 18:15:57 -0400 |
|---|---|---|
| committer | Michal Marek <mmarek@suse.cz> | 2010-10-27 18:15:57 -0400 |
| commit | b74b953b998bcc2db91b694446f3a2619ec32de6 (patch) | |
| tree | 6ce24caabd730f6ae9287ed0676ec32e6ff31e9d /net/ipv4/raw.c | |
| parent | abb438526201c6a79949ad45375c051b6681c253 (diff) | |
| parent | f6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff) | |
Merge commit 'v2.6.36' into kbuild/misc
Update to be able to fix a recent change to scripts/basic/docproc.c
(commit eda603f).
Diffstat (limited to 'net/ipv4/raw.c')
| -rw-r--r-- | net/ipv4/raw.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index ce154b47f1da..009a7b2aa1ef 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
| @@ -60,7 +60,6 @@ | |||
| 60 | #include <net/net_namespace.h> | 60 | #include <net/net_namespace.h> |
| 61 | #include <net/dst.h> | 61 | #include <net/dst.h> |
| 62 | #include <net/sock.h> | 62 | #include <net/sock.h> |
| 63 | #include <linux/gfp.h> | ||
| 64 | #include <linux/ip.h> | 63 | #include <linux/ip.h> |
| 65 | #include <linux/net.h> | 64 | #include <linux/net.h> |
| 66 | #include <net/ip.h> | 65 | #include <net/ip.h> |
| @@ -291,7 +290,7 @@ static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb) | |||
| 291 | { | 290 | { |
| 292 | /* Charge it to the socket. */ | 291 | /* Charge it to the socket. */ |
| 293 | 292 | ||
| 294 | if (sock_queue_rcv_skb(sk, skb) < 0) { | 293 | if (ip_queue_rcv_skb(sk, skb) < 0) { |
| 295 | kfree_skb(skb); | 294 | kfree_skb(skb); |
| 296 | return NET_RX_DROP; | 295 | return NET_RX_DROP; |
| 297 | } | 296 | } |
| @@ -315,7 +314,7 @@ int raw_rcv(struct sock *sk, struct sk_buff *skb) | |||
| 315 | } | 314 | } |
| 316 | 315 | ||
| 317 | static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, | 316 | static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, |
| 318 | struct rtable *rt, | 317 | struct rtable **rtp, |
| 319 | unsigned int flags) | 318 | unsigned int flags) |
| 320 | { | 319 | { |
| 321 | struct inet_sock *inet = inet_sk(sk); | 320 | struct inet_sock *inet = inet_sk(sk); |
| @@ -324,25 +323,27 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, | |||
| 324 | struct sk_buff *skb; | 323 | struct sk_buff *skb; |
| 325 | unsigned int iphlen; | 324 | unsigned int iphlen; |
| 326 | int err; | 325 | int err; |
| 326 | struct rtable *rt = *rtp; | ||
| 327 | 327 | ||
| 328 | if (length > rt->u.dst.dev->mtu) { | 328 | if (length > rt->dst.dev->mtu) { |
| 329 | ip_local_error(sk, EMSGSIZE, rt->rt_dst, inet->inet_dport, | 329 | ip_local_error(sk, EMSGSIZE, rt->rt_dst, inet->inet_dport, |
| 330 | rt->u.dst.dev->mtu); | 330 | rt->dst.dev->mtu); |
| 331 | return -EMSGSIZE; | 331 | return -EMSGSIZE; |
| 332 | } | 332 | } |
| 333 | if (flags&MSG_PROBE) | 333 | if (flags&MSG_PROBE) |
| 334 | goto out; | 334 | goto out; |
| 335 | 335 | ||
| 336 | skb = sock_alloc_send_skb(sk, | 336 | skb = sock_alloc_send_skb(sk, |
| 337 | length + LL_ALLOCATED_SPACE(rt->u.dst.dev) + 15, | 337 | length + LL_ALLOCATED_SPACE(rt->dst.dev) + 15, |
| 338 | flags & MSG_DONTWAIT, &err); | 338 | flags & MSG_DONTWAIT, &err); |
| 339 | if (skb == NULL) | 339 | if (skb == NULL) |
| 340 | goto error; | 340 | goto error; |
| 341 | skb_reserve(skb, LL_RESERVED_SPACE(rt->u.dst.dev)); | 341 | skb_reserve(skb, LL_RESERVED_SPACE(rt->dst.dev)); |
| 342 | 342 | ||
| 343 | skb->priority = sk->sk_priority; | 343 | skb->priority = sk->sk_priority; |
| 344 | skb->mark = sk->sk_mark; | 344 | skb->mark = sk->sk_mark; |
| 345 | skb_dst_set(skb, dst_clone(&rt->u.dst)); | 345 | skb_dst_set(skb, &rt->dst); |
| 346 | *rtp = NULL; | ||
| 346 | 347 | ||
| 347 | skb_reset_network_header(skb); | 348 | skb_reset_network_header(skb); |
| 348 | iph = ip_hdr(skb); | 349 | iph = ip_hdr(skb); |
| @@ -374,7 +375,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, | |||
| 374 | iph->check = 0; | 375 | iph->check = 0; |
| 375 | iph->tot_len = htons(length); | 376 | iph->tot_len = htons(length); |
| 376 | if (!iph->id) | 377 | if (!iph->id) |
| 377 | ip_select_ident(iph, &rt->u.dst, NULL); | 378 | ip_select_ident(iph, &rt->dst, NULL); |
| 378 | 379 | ||
| 379 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); | 380 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); |
| 380 | } | 381 | } |
| @@ -382,8 +383,8 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, | |||
| 382 | icmp_out_count(net, ((struct icmphdr *) | 383 | icmp_out_count(net, ((struct icmphdr *) |
| 383 | skb_transport_header(skb))->type); | 384 | skb_transport_header(skb))->type); |
| 384 | 385 | ||
| 385 | err = NF_HOOK(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev, | 386 | err = NF_HOOK(NFPROTO_IPV4, NF_INET_LOCAL_OUT, skb, NULL, |
| 386 | dst_output); | 387 | rt->dst.dev, dst_output); |
| 387 | if (err > 0) | 388 | if (err > 0) |
| 388 | err = net_xmit_errno(err); | 389 | err = net_xmit_errno(err); |
| 389 | if (err) | 390 | if (err) |
| @@ -577,7 +578,7 @@ back_from_confirm: | |||
| 577 | 578 | ||
| 578 | if (inet->hdrincl) | 579 | if (inet->hdrincl) |
| 579 | err = raw_send_hdrinc(sk, msg->msg_iov, len, | 580 | err = raw_send_hdrinc(sk, msg->msg_iov, len, |
| 580 | rt, msg->msg_flags); | 581 | &rt, msg->msg_flags); |
| 581 | 582 | ||
| 582 | else { | 583 | else { |
| 583 | if (!ipc.addr) | 584 | if (!ipc.addr) |
| @@ -605,7 +606,7 @@ out: | |||
| 605 | return len; | 606 | return len; |
| 606 | 607 | ||
| 607 | do_confirm: | 608 | do_confirm: |
| 608 | dst_confirm(&rt->u.dst); | 609 | dst_confirm(&rt->dst); |
| 609 | if (!(msg->msg_flags & MSG_PROBE) || len) | 610 | if (!(msg->msg_flags & MSG_PROBE) || len) |
| 610 | goto back_from_confirm; | 611 | goto back_from_confirm; |
| 611 | err = 0; | 612 | err = 0; |
