summaryrefslogtreecommitdiff
path: root/include/net/ipv6.h
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-12-15 14:51:17 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-12-15 14:51:17 +0100
commite6d111cd909551cec5902358db1e25dcaa8c86bb (patch)
tree99673aec563c76a1a4d7ca2d31b90b47549ae40b /include/net/ipv6.h
parent1dcb97e485420a25461cc44d43f987c8bbf50e7a (diff)
parent07cc49f66973f49a391c91bf4b158fa0f2562ca8 (diff)
Merge tag 'v4.1.15' into toradex_vf_4.1-nextColibri_VF_LinuxImageV2.5Beta3_20151215
This is the 4.1.15 stable release
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r--include/net/ipv6.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index eec8ad3c9843..df555ecd4002 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -205,6 +205,7 @@ extern rwlock_t ip6_ra_lock;
*/
struct ipv6_txoptions {
+ atomic_t refcnt;
/* Length of this structure */
int tot_len;
@@ -217,7 +218,7 @@ struct ipv6_txoptions {
struct ipv6_opt_hdr *dst0opt;
struct ipv6_rt_hdr *srcrt; /* Routing Header */
struct ipv6_opt_hdr *dst1opt;
-
+ struct rcu_head rcu;
/* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */
};
@@ -250,6 +251,24 @@ struct ipv6_fl_socklist {
struct rcu_head rcu;
};
+static inline struct ipv6_txoptions *txopt_get(const struct ipv6_pinfo *np)
+{
+ struct ipv6_txoptions *opt;
+
+ rcu_read_lock();
+ opt = rcu_dereference(np->opt);
+ if (opt && !atomic_inc_not_zero(&opt->refcnt))
+ opt = NULL;
+ rcu_read_unlock();
+ return opt;
+}
+
+static inline void txopt_put(struct ipv6_txoptions *opt)
+{
+ if (opt && atomic_dec_and_test(&opt->refcnt))
+ kfree_rcu(opt, rcu);
+}
+
struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label);
struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space,
struct ip6_flowlabel *fl,
@@ -488,6 +507,7 @@ struct ip6_create_arg {
u32 user;
const struct in6_addr *src;
const struct in6_addr *dst;
+ int iif;
u8 ecn;
};