diff options
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r-- | net/ipv6/raw.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index ed3a76b30fd9..2ad37893334a 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -655,6 +655,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
655 | struct flowi fl; | 655 | struct flowi fl; |
656 | int addr_len = msg->msg_namelen; | 656 | int addr_len = msg->msg_namelen; |
657 | int hlimit = -1; | 657 | int hlimit = -1; |
658 | int tclass = -1; | ||
658 | u16 proto; | 659 | u16 proto; |
659 | int err; | 660 | int err; |
660 | 661 | ||
@@ -740,7 +741,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
740 | memset(opt, 0, sizeof(struct ipv6_txoptions)); | 741 | memset(opt, 0, sizeof(struct ipv6_txoptions)); |
741 | opt->tot_len = sizeof(struct ipv6_txoptions); | 742 | opt->tot_len = sizeof(struct ipv6_txoptions); |
742 | 743 | ||
743 | err = datagram_send_ctl(msg, &fl, opt, &hlimit); | 744 | err = datagram_send_ctl(msg, &fl, opt, &hlimit, &tclass); |
744 | if (err < 0) { | 745 | if (err < 0) { |
745 | fl6_sock_release(flowlabel); | 746 | fl6_sock_release(flowlabel); |
746 | return err; | 747 | return err; |
@@ -755,8 +756,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
755 | } | 756 | } |
756 | if (opt == NULL) | 757 | if (opt == NULL) |
757 | opt = np->opt; | 758 | opt = np->opt; |
758 | if (flowlabel) | 759 | opt = fl6_merge_options(&opt_space, flowlabel, opt); |
759 | opt = fl6_merge_options(&opt_space, flowlabel, opt); | ||
760 | 760 | ||
761 | fl.proto = proto; | 761 | fl.proto = proto; |
762 | rawv6_probe_proto_opt(&fl, msg); | 762 | rawv6_probe_proto_opt(&fl, msg); |
@@ -798,6 +798,12 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
798 | hlimit = ipv6_get_hoplimit(dst->dev); | 798 | hlimit = ipv6_get_hoplimit(dst->dev); |
799 | } | 799 | } |
800 | 800 | ||
801 | if (tclass < 0) { | ||
802 | tclass = np->cork.tclass; | ||
803 | if (tclass < 0) | ||
804 | tclass = 0; | ||
805 | } | ||
806 | |||
801 | if (msg->msg_flags&MSG_CONFIRM) | 807 | if (msg->msg_flags&MSG_CONFIRM) |
802 | goto do_confirm; | 808 | goto do_confirm; |
803 | 809 | ||
@@ -806,8 +812,9 @@ back_from_confirm: | |||
806 | err = rawv6_send_hdrinc(sk, msg->msg_iov, len, &fl, (struct rt6_info*)dst, msg->msg_flags); | 812 | err = rawv6_send_hdrinc(sk, msg->msg_iov, len, &fl, (struct rt6_info*)dst, msg->msg_flags); |
807 | } else { | 813 | } else { |
808 | lock_sock(sk); | 814 | lock_sock(sk); |
809 | err = ip6_append_data(sk, ip_generic_getfrag, msg->msg_iov, len, 0, | 815 | err = ip6_append_data(sk, ip_generic_getfrag, msg->msg_iov, |
810 | hlimit, opt, &fl, (struct rt6_info*)dst, msg->msg_flags); | 816 | len, 0, hlimit, tclass, opt, &fl, (struct rt6_info*)dst, |
817 | msg->msg_flags); | ||
811 | 818 | ||
812 | if (err) | 819 | if (err) |
813 | ip6_flush_pending_frames(sk); | 820 | ip6_flush_pending_frames(sk); |