|
@@ -598,13 +598,6 @@ static struct xfrm_state *xfrm_state_construct(struct net *net,
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
|
|
|
|
- if (attrs[XFRMA_OFFLOAD_DEV]) {
|
|
|
|
- err = xfrm_dev_state_add(net, x,
|
|
|
|
- nla_data(attrs[XFRMA_OFFLOAD_DEV]));
|
|
|
|
- if (err)
|
|
|
|
- goto error;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if ((err = xfrm_alloc_replay_state_esn(&x->replay_esn, &x->preplay_esn,
|
|
if ((err = xfrm_alloc_replay_state_esn(&x->replay_esn, &x->preplay_esn,
|
|
attrs[XFRMA_REPLAY_ESN_VAL])))
|
|
attrs[XFRMA_REPLAY_ESN_VAL])))
|
|
goto error;
|
|
goto error;
|
|
@@ -620,6 +613,14 @@ static struct xfrm_state *xfrm_state_construct(struct net *net,
|
|
/* override default values from above */
|
|
/* override default values from above */
|
|
xfrm_update_ae_params(x, attrs, 0);
|
|
xfrm_update_ae_params(x, attrs, 0);
|
|
|
|
|
|
|
|
+ /* configure the hardware if offload is requested */
|
|
|
|
+ if (attrs[XFRMA_OFFLOAD_DEV]) {
|
|
|
|
+ err = xfrm_dev_state_add(net, x,
|
|
|
|
+ nla_data(attrs[XFRMA_OFFLOAD_DEV]));
|
|
|
|
+ if (err)
|
|
|
|
+ goto error;
|
|
|
|
+ }
|
|
|
|
+
|
|
return x;
|
|
return x;
|
|
|
|
|
|
error:
|
|
error:
|
|
@@ -662,6 +663,9 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (x->km.state == XFRM_STATE_VOID)
|
|
|
|
+ x->km.state = XFRM_STATE_VALID;
|
|
|
|
+
|
|
c.seq = nlh->nlmsg_seq;
|
|
c.seq = nlh->nlmsg_seq;
|
|
c.portid = nlh->nlmsg_pid;
|
|
c.portid = nlh->nlmsg_pid;
|
|
c.event = nlh->nlmsg_type;
|
|
c.event = nlh->nlmsg_type;
|