aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ip6_flowlabel.c8
-rw-r--r--net/ipv6/ipv6_sockglue.c5
2 files changed, 11 insertions, 2 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,
481 spin_unlock_bh(&ip6_sk_fl_lock); 481 spin_unlock_bh(&ip6_sk_fl_lock);
482} 482}
483 483
484int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq) 484int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
485 int flags)
485{ 486{
486 struct ipv6_pinfo *np = inet6_sk(sk); 487 struct ipv6_pinfo *np = inet6_sk(sk);
487 struct ipv6_fl_socklist *sfl; 488 struct ipv6_fl_socklist *sfl;
488 489
490 if (flags & IPV6_FL_F_REMOTE) {
491 freq->flr_label = np->rcv_flowinfo & IPV6_FLOWLABEL_MASK;
492 return 0;
493 }
494
489 if (np->repflow) { 495 if (np->repflow) {
490 freq->flr_label = np->flow_label; 496 freq->flr_label = np->flow_label;
491 return 0; 497 return 0;
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 2855b00ed49d..7024a874e901 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -1221,6 +1221,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
1221 case IPV6_FLOWLABEL_MGR: 1221 case IPV6_FLOWLABEL_MGR:
1222 { 1222 {
1223 struct in6_flowlabel_req freq; 1223 struct in6_flowlabel_req freq;
1224 int flags;
1224 1225
1225 if (len < sizeof(freq)) 1226 if (len < sizeof(freq))
1226 return -EINVAL; 1227 return -EINVAL;
@@ -1232,9 +1233,11 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
1232 return -EINVAL; 1233 return -EINVAL;
1233 1234
1234 len = sizeof(freq); 1235 len = sizeof(freq);
1236 flags = freq.flr_flags;
1237
1235 memset(&freq, 0, sizeof(freq)); 1238 memset(&freq, 0, sizeof(freq));
1236 1239
1237 val = ipv6_flowlabel_opt_get(sk, &freq); 1240 val = ipv6_flowlabel_opt_get(sk, &freq, flags);
1238 if (val < 0) 1241 if (val < 0)
1239 return val; 1242 return val;
1240 1243