aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/xfrm.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 93d184b91a8c..6d85861ab990 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -162,7 +162,7 @@ struct xfrm_state {
162 struct xfrm_lifetime_cfg lft; 162 struct xfrm_lifetime_cfg lft;
163 163
164 /* Data for transformer */ 164 /* Data for transformer */
165 struct xfrm_algo *aalg; 165 struct xfrm_algo_auth *aalg;
166 struct xfrm_algo *ealg; 166 struct xfrm_algo *ealg;
167 struct xfrm_algo *calg; 167 struct xfrm_algo *calg;
168 struct xfrm_algo_aead *aead; 168 struct xfrm_algo_aead *aead;
@@ -1532,12 +1532,22 @@ static inline int xfrm_alg_len(struct xfrm_algo *alg)
1532 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); 1532 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
1533} 1533}
1534 1534
1535static inline int xfrm_alg_auth_len(struct xfrm_algo_auth *alg)
1536{
1537 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
1538}
1539
1535#ifdef CONFIG_XFRM_MIGRATE 1540#ifdef CONFIG_XFRM_MIGRATE
1536static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig) 1541static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig)
1537{ 1542{
1538 return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL); 1543 return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL);
1539} 1544}
1540 1545
1546static inline struct xfrm_algo_auth *xfrm_algo_auth_clone(struct xfrm_algo_auth *orig)
1547{
1548 return kmemdup(orig, xfrm_alg_auth_len(orig), GFP_KERNEL);
1549}
1550
1541static inline void xfrm_states_put(struct xfrm_state **states, int n) 1551static inline void xfrm_states_put(struct xfrm_state **states, int n)
1542{ 1552{
1543 int i; 1553 int i;