Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Steffen Klassert says: ==================== pull request (net-next): ipsec-next 2017-12-15 1) Currently we can add or update socket policies, but not clear them. Support clearing of socket policies too. From Lorenzo Colitti. 2) Add documentation for the xfrm device offload api. From Shannon Nelson. 3) Fix IPsec extended sequence numbers (ESN) for IPsec offloading. From Yossef Efraim. 4) xfrm_dev_state_add function returns success even for unsupported options, fix this to fail in such cases. From Yossef Efraim. 5) Remove a redundant xfrm_state assignment. From Aviv Heller. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -67,7 +67,7 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
|
||||
|
||||
/* We don't yet support UDP encapsulation, TFC padding and ESN. */
|
||||
if (x->encap || x->tfcpad || (x->props.flags & XFRM_STATE_ESN))
|
||||
return 0;
|
||||
return -EINVAL;
|
||||
|
||||
dev = dev_get_by_index(net, xuo->ifindex);
|
||||
if (!dev) {
|
||||
|
||||
@@ -231,7 +231,6 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
|
||||
|
||||
if (xo && (xo->flags & CRYPTO_DONE)) {
|
||||
crypto_done = true;
|
||||
x = xfrm_input_state(skb);
|
||||
family = XFRM_SPI_SKB_CB(skb)->family;
|
||||
|
||||
if (!(xo->status & CRYPTO_SUCCESS)) {
|
||||
|
||||
@@ -1251,7 +1251,7 @@ EXPORT_SYMBOL(xfrm_policy_delete);
|
||||
|
||||
int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol)
|
||||
{
|
||||
struct net *net = xp_net(pol);
|
||||
struct net *net = sock_net(sk);
|
||||
struct xfrm_policy *old_pol;
|
||||
|
||||
#ifdef CONFIG_XFRM_SUB_POLICY
|
||||
|
||||
@@ -666,7 +666,7 @@ static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff
|
||||
if (unlikely(oseq < replay_esn->oseq)) {
|
||||
XFRM_SKB_CB(skb)->seq.output.hi = ++oseq_hi;
|
||||
xo->seq.hi = oseq_hi;
|
||||
|
||||
replay_esn->oseq_hi = oseq_hi;
|
||||
if (replay_esn->oseq_hi == 0) {
|
||||
replay_esn->oseq--;
|
||||
replay_esn->oseq_hi--;
|
||||
@@ -678,7 +678,6 @@ static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff
|
||||
}
|
||||
|
||||
replay_esn->oseq = oseq;
|
||||
replay_esn->oseq_hi = oseq_hi;
|
||||
|
||||
if (xfrm_aevent_is_on(net))
|
||||
x->repl->notify(x, XFRM_REPLAY_UPDATE);
|
||||
|
||||
@@ -2048,6 +2048,13 @@ int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen
|
||||
struct xfrm_mgr *km;
|
||||
struct xfrm_policy *pol = NULL;
|
||||
|
||||
if (!optval && !optlen) {
|
||||
xfrm_sk_policy_insert(sk, XFRM_POLICY_IN, NULL);
|
||||
xfrm_sk_policy_insert(sk, XFRM_POLICY_OUT, NULL);
|
||||
__sk_dst_reset(sk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (optlen <= 0 || optlen > PAGE_SIZE)
|
||||
return -EMSGSIZE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user