diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-09-07 21:19:03 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-09-07 21:19:03 -0400 |
commit | 41a1f8ea4fbfcdc4232f023732584aae2220de31 (patch) | |
tree | 9939686b354ced0b22d81efcbc12f5ed90372b09 /net/ipv6/raw.c | |
parent | 333fad5364d6b457c8d837f7d05802d2aaf8a961 (diff) |
[IPV6]: Support IPV6_{RECV,}TCLASS socket options / ancillary data.
Based on patch from David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
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); |