diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2005-09-08 21:59:43 +0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-09-08 21:59:43 +0200 |
commit | 2e66fc41169c90d93b7811caf7e7822de6aa2259 (patch) | |
tree | 014db698b03f898c560919e56fbdae8ca6ad3dd5 /net/ipv6/udp.c | |
parent | [IPV6]: Need to use pskb_trim_rcsum(). (diff) | |
parent | [IPV6]: Support IPV6_{RECV,}TCLASS socket options / ancillary data. (diff) | |
download | linux-2e66fc41169c90d93b7811caf7e7822de6aa2259.tar.xz linux-2e66fc41169c90d93b7811caf7e7822de6aa2259.zip |
Merge git://git.skbuff.net/gitroot/yoshfuji/linux-2.6-git-rfc3542
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r-- | net/ipv6/udp.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 7cbcaa30cf5e..f5ae14810a70 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -637,6 +637,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, int addr_len = msg->msg_namelen; int ulen = len; int hlimit = -1; + int tclass = -1; int corkreq = up->corkflag || msg->msg_flags&MSG_MORE; int err; @@ -758,7 +759,7 @@ do_udp_sendmsg: memset(opt, 0, sizeof(struct ipv6_txoptions)); opt->tot_len = sizeof(*opt); - err = datagram_send_ctl(msg, fl, opt, &hlimit); + err = datagram_send_ctl(msg, fl, opt, &hlimit, &tclass); if (err < 0) { fl6_sock_release(flowlabel); return err; @@ -773,8 +774,7 @@ do_udp_sendmsg: } if (opt == NULL) opt = np->opt; - if (flowlabel) - opt = fl6_merge_options(&opt_space, flowlabel, opt); + opt = fl6_merge_options(&opt_space, flowlabel, opt); fl->proto = IPPROTO_UDP; ipv6_addr_copy(&fl->fl6_dst, daddr); @@ -815,6 +815,12 @@ do_udp_sendmsg: hlimit = ipv6_get_hoplimit(dst->dev); } + if (tclass < 0) { + tclass = np->tclass; + if (tclass < 0) + tclass = 0; + } + if (msg->msg_flags&MSG_CONFIRM) goto do_confirm; back_from_confirm: @@ -834,9 +840,10 @@ back_from_confirm: do_append_data: up->len += ulen; - err = ip6_append_data(sk, ip_generic_getfrag, msg->msg_iov, ulen, sizeof(struct udphdr), - hlimit, opt, fl, (struct rt6_info*)dst, - corkreq ? msg->msg_flags|MSG_MORE : msg->msg_flags); + err = ip6_append_data(sk, ip_generic_getfrag, msg->msg_iov, ulen, + sizeof(struct udphdr), hlimit, tclass, opt, fl, + (struct rt6_info*)dst, + corkreq ? msg->msg_flags|MSG_MORE : msg->msg_flags); if (err) udp_v6_flush_pending_frames(sk); else if (!corkreq) |