diff options
Diffstat (limited to 'net/ipv6/raw.c')
| -rw-r--r-- | net/ipv6/raw.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 1352c1d9bf4d..617645bc5ed6 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
| @@ -455,11 +455,11 @@ csum_copy_err: | |||
| 455 | static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl, | 455 | static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl, |
| 456 | struct raw6_sock *rp) | 456 | struct raw6_sock *rp) |
| 457 | { | 457 | { |
| 458 | struct inet_sock *inet = inet_sk(sk); | ||
| 459 | struct sk_buff *skb; | 458 | struct sk_buff *skb; |
| 460 | int err = 0; | 459 | int err = 0; |
| 461 | int offset; | 460 | int offset; |
| 462 | int len; | 461 | int len; |
| 462 | int total_len; | ||
| 463 | u32 tmp_csum; | 463 | u32 tmp_csum; |
| 464 | u16 csum; | 464 | u16 csum; |
| 465 | 465 | ||
| @@ -470,7 +470,8 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl, | |||
| 470 | goto out; | 470 | goto out; |
| 471 | 471 | ||
| 472 | offset = rp->offset; | 472 | offset = rp->offset; |
| 473 | if (offset >= inet->cork.length - 1) { | 473 | total_len = inet_sk(sk)->cork.length - (skb->nh.raw - skb->data); |
| 474 | if (offset >= total_len - 1) { | ||
| 474 | err = -EINVAL; | 475 | err = -EINVAL; |
| 475 | ip6_flush_pending_frames(sk); | 476 | ip6_flush_pending_frames(sk); |
| 476 | goto out; | 477 | goto out; |
| @@ -514,7 +515,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl, | |||
| 514 | 515 | ||
| 515 | tmp_csum = csum_ipv6_magic(&fl->fl6_src, | 516 | tmp_csum = csum_ipv6_magic(&fl->fl6_src, |
| 516 | &fl->fl6_dst, | 517 | &fl->fl6_dst, |
| 517 | inet->cork.length, fl->proto, tmp_csum); | 518 | total_len, fl->proto, tmp_csum); |
| 518 | 519 | ||
| 519 | if (tmp_csum == 0) | 520 | if (tmp_csum == 0) |
| 520 | tmp_csum = -1; | 521 | tmp_csum = -1; |
