|
@@ -1601,6 +1601,28 @@ static inline int xfrm_replay_state_esn_len(struct xfrm_replay_state_esn *replay
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef CONFIG_XFRM_MIGRATE
|
|
#ifdef CONFIG_XFRM_MIGRATE
|
|
|
|
+static inline int xfrm_replay_clone(struct xfrm_state *x,
|
|
|
|
+ struct xfrm_state *orig)
|
|
|
|
+{
|
|
|
|
+ x->replay_esn = kzalloc(xfrm_replay_state_esn_len(orig->replay_esn),
|
|
|
|
+ GFP_KERNEL);
|
|
|
|
+ if (!x->replay_esn)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+
|
|
|
|
+ x->replay_esn->bmp_len = orig->replay_esn->bmp_len;
|
|
|
|
+ x->replay_esn->replay_window = orig->replay_esn->replay_window;
|
|
|
|
+
|
|
|
|
+ x->preplay_esn = kmemdup(x->replay_esn,
|
|
|
|
+ xfrm_replay_state_esn_len(x->replay_esn),
|
|
|
|
+ GFP_KERNEL);
|
|
|
|
+ if (!x->preplay_esn) {
|
|
|
|
+ kfree(x->replay_esn);
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig)
|
|
static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig)
|
|
{
|
|
{
|
|
return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL);
|
|
return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL);
|