summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_flowlabel.c
diff options
context:
space:
mode:
authorFlorent Fourcot <florent.fourcot@enst-bretagne.fr>2014-01-17 17:15:04 +0100
committerDavid S. Miller <davem@davemloft.net>2014-01-20 02:12:31 +0100
commit46e5f401762c639e38eea350d335c0f54ec2442f (patch)
tree76f12d6f2425d05a13f09e27cd66c981b29312f4 /net/ipv6/ip6_flowlabel.c
parentipv6: add the IPV6_FL_F_REFLECT flag to IPV6_FL_A_GET (diff)
downloadlinux-46e5f401762c639e38eea350d335c0f54ec2442f.tar.xz
linux-46e5f401762c639e38eea350d335c0f54ec2442f.zip
ipv6: add a flag to get the flow label used remotly
This information is already available via IPV6_FLOWINFO of IPV6_2292PKTOPTIONS, and them a filtering to get the flow label information. But it is probably logical and easier for users to add this here, and to control both sent/received flow label values with the IPV6_FLOWLABEL_MGR option. Signed-off-by: Florent Fourcot <florent.fourcot@enst-bretagne.fr> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_flowlabel.c')
-rw-r--r--net/ipv6/ip6_flowlabel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 55823f187446..01bf2524c72a 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -481,11 +481,17 @@ static inline void fl_link(struct ipv6_pinfo *np, struct ipv6_fl_socklist *sfl,
spin_unlock_bh(&ip6_sk_fl_lock);
}
-int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq)
+int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
+ int flags)
{
struct ipv6_pinfo *np = inet6_sk(sk);
struct ipv6_fl_socklist *sfl;
+ if (flags & IPV6_FL_F_REMOTE) {
+ freq->flr_label = np->rcv_flowinfo & IPV6_FLOWLABEL_MASK;
+ return 0;
+ }
+
if (np->repflow) {
freq->flr_label = np->flow_label;
return 0;