|
@@ -475,6 +475,32 @@ 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)
|
|
|
+{
|
|
|
+ struct ipv6_pinfo *np = inet6_sk(sk);
|
|
|
+ struct ipv6_fl_socklist *sfl;
|
|
|
+
|
|
|
+ rcu_read_lock_bh();
|
|
|
+
|
|
|
+ for_each_sk_fl_rcu(np, sfl) {
|
|
|
+ if (sfl->fl->label == (np->flow_label & IPV6_FLOWLABEL_MASK)) {
|
|
|
+ spin_lock_bh(&ip6_fl_lock);
|
|
|
+ freq->flr_label = sfl->fl->label;
|
|
|
+ freq->flr_dst = sfl->fl->dst;
|
|
|
+ freq->flr_share = sfl->fl->share;
|
|
|
+ freq->flr_expires = (sfl->fl->expires - jiffies) / HZ;
|
|
|
+ freq->flr_linger = sfl->fl->linger / HZ;
|
|
|
+
|
|
|
+ spin_unlock_bh(&ip6_fl_lock);
|
|
|
+ rcu_read_unlock_bh();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ rcu_read_unlock_bh();
|
|
|
+
|
|
|
+ return -ENOENT;
|
|
|
+}
|
|
|
+
|
|
|
int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
|
|
|
{
|
|
|
int uninitialized_var(err);
|