.. | .. |
---|
539 | 539 | static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, |
---|
540 | 540 | struct raw6_sock *rp) |
---|
541 | 541 | { |
---|
| 542 | + struct ipv6_txoptions *opt; |
---|
542 | 543 | struct sk_buff *skb; |
---|
543 | 544 | int err = 0; |
---|
544 | 545 | int offset; |
---|
.. | .. |
---|
556 | 557 | |
---|
557 | 558 | offset = rp->offset; |
---|
558 | 559 | total_len = inet_sk(sk)->cork.base.length; |
---|
| 560 | + opt = inet6_sk(sk)->cork.opt; |
---|
| 561 | + total_len -= opt ? opt->opt_flen : 0; |
---|
| 562 | + |
---|
559 | 563 | if (offset >= total_len - 1) { |
---|
560 | 564 | err = -EINVAL; |
---|
561 | 565 | ip6_flush_pending_frames(sk); |
---|
.. | .. |
---|
824 | 828 | |
---|
825 | 829 | if (!proto) |
---|
826 | 830 | proto = inet->inet_num; |
---|
827 | | - else if (proto != inet->inet_num) |
---|
| 831 | + else if (proto != inet->inet_num && |
---|
| 832 | + inet->inet_num != IPPROTO_RAW) |
---|
828 | 833 | return -EINVAL; |
---|
829 | 834 | |
---|
830 | 835 | if (proto > 255) |
---|
.. | .. |
---|
1207 | 1212 | lock_sock(sk); |
---|
1208 | 1213 | ip6_flush_pending_frames(sk); |
---|
1209 | 1214 | release_sock(sk); |
---|
1210 | | - |
---|
1211 | | - inet6_destroy_sock(sk); |
---|
1212 | 1215 | } |
---|
1213 | 1216 | |
---|
1214 | 1217 | static int rawv6_init_sk(struct sock *sk) |
---|