aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorFlorent Fourcot <florent.fourcot@enst-bretagne.fr>2013-12-08 09:46:57 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-09 21:03:49 -0500
commit1397ed35f22d7c30d0b89ba74b6b7829220dfcfd (patch)
treed6c3ce6a964fd25d5f0348523bf47c28e5af273d /net/ipv6/tcp_ipv6.c
parent5824d2d16d39a9c57aa3bacf955fbd0c2134061f (diff)
ipv6: add flowinfo for tcp6 pkt_options for all cases
The current implementation of IPV6_FLOWINFO only gives a result if pktoptions is available (thanks to the ip6_datagram_recv_ctl function). It gives inconsistent results to user space, sometimes there is a result for getsockopt(IPV6_FLOWINFO), sometimes not. This patch add rcv_flowinfo to store it, and return it to the userspace in the same way than other pkt_options. Signed-off-by: Florent Fourcot <florent.fourcot@enst-bretagne.fr> Reviewed-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 0740f93a114a..79a196369558 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1136,6 +1136,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1136 newnp->mcast_oif = inet6_iif(skb); 1136 newnp->mcast_oif = inet6_iif(skb);
1137 newnp->mcast_hops = ipv6_hdr(skb)->hop_limit; 1137 newnp->mcast_hops = ipv6_hdr(skb)->hop_limit;
1138 newnp->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb)); 1138 newnp->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb));
1139 newnp->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(skb));
1139 1140
1140 /* 1141 /*
1141 * No need to charge this sock to the relevant IPv6 refcnt debug socks count 1142 * No need to charge this sock to the relevant IPv6 refcnt debug socks count
@@ -1216,6 +1217,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1216 newnp->mcast_oif = inet6_iif(skb); 1217 newnp->mcast_oif = inet6_iif(skb);
1217 newnp->mcast_hops = ipv6_hdr(skb)->hop_limit; 1218 newnp->mcast_hops = ipv6_hdr(skb)->hop_limit;
1218 newnp->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb)); 1219 newnp->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb));
1220 newnp->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(skb));
1219 1221
1220 /* Clone native IPv6 options from listening socket (if any) 1222 /* Clone native IPv6 options from listening socket (if any)
1221 1223
@@ -1427,6 +1429,8 @@ ipv6_pktoptions:
1427 np->mcast_hops = ipv6_hdr(opt_skb)->hop_limit; 1429 np->mcast_hops = ipv6_hdr(opt_skb)->hop_limit;
1428 if (np->rxopt.bits.rxtclass) 1430 if (np->rxopt.bits.rxtclass)
1429 np->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(opt_skb)); 1431 np->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(opt_skb));
1432 if (np->rxopt.bits.rxflow)
1433 np->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(opt_skb));
1430 if (ipv6_opt_accepted(sk, opt_skb)) { 1434 if (ipv6_opt_accepted(sk, opt_skb)) {
1431 skb_set_owner_r(opt_skb, sk); 1435 skb_set_owner_r(opt_skb, sk);
1432 opt_skb = xchg(&np->pktoptions, opt_skb); 1436 opt_skb = xchg(&np->pktoptions, opt_skb);