diff options
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r-- | net/ipv6/raw.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index e527a1652d7c..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; |
@@ -797,6 +798,12 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
797 | hlimit = ipv6_get_hoplimit(dst->dev); | 798 | hlimit = ipv6_get_hoplimit(dst->dev); |
798 | } | 799 | } |
799 | 800 | ||
801 | if (tclass < 0) { | ||
802 | tclass = np->cork.tclass; | ||
803 | if (tclass < 0) | ||
804 | tclass = 0; | ||
805 | } | ||
806 | |||
800 | if (msg->msg_flags&MSG_CONFIRM) | 807 | if (msg->msg_flags&MSG_CONFIRM) |
801 | goto do_confirm; | 808 | goto do_confirm; |
802 | 809 | ||
@@ -805,8 +812,9 @@ back_from_confirm: | |||
805 | 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); |
806 | } else { | 813 | } else { |
807 | lock_sock(sk); | 814 | lock_sock(sk); |
808 | 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, |
809 | 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); | ||
810 | 818 | ||
811 | if (err) | 819 | if (err) |
812 | ip6_flush_pending_frames(sk); | 820 | ip6_flush_pending_frames(sk); |