Commit 26a8ba2c authored by David S. Miller's avatar David S. Miller

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-10-30

1) Change some variables that can't be negative
   from int to unsigned int. From Alexey Dobriyan.

2) Remove a redundant header initialization in esp6.
   From Colin Ian King.

3) Some BUG to BUG_ON conversions.
   From Gustavo A. R. Silva.

Please pull or let me know if there are problems.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 28ef7de7 eee12df5
...@@ -1764,22 +1764,22 @@ static inline int xfrm_acquire_is_on(struct net *net) ...@@ -1764,22 +1764,22 @@ static inline int xfrm_acquire_is_on(struct net *net)
} }
#endif #endif
static inline int aead_len(struct xfrm_algo_aead *alg) static inline unsigned int aead_len(struct xfrm_algo_aead *alg)
{ {
return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
} }
static inline int xfrm_alg_len(const struct xfrm_algo *alg) static inline unsigned int xfrm_alg_len(const struct xfrm_algo *alg)
{ {
return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
} }
static inline int xfrm_alg_auth_len(const struct xfrm_algo_auth *alg) static inline unsigned int xfrm_alg_auth_len(const struct xfrm_algo_auth *alg)
{ {
return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
} }
static inline int xfrm_replay_state_esn_len(struct xfrm_replay_state_esn *replay_esn) static inline unsigned int xfrm_replay_state_esn_len(struct xfrm_replay_state_esn *replay_esn)
{ {
return sizeof(*replay_esn) + replay_esn->bmp_len * sizeof(__u32); return sizeof(*replay_esn) + replay_esn->bmp_len * sizeof(__u32);
} }
......
...@@ -483,8 +483,8 @@ static inline int esp_remove_trailer(struct sk_buff *skb) ...@@ -483,8 +483,8 @@ static inline int esp_remove_trailer(struct sk_buff *skb)
goto out; goto out;
} }
if (skb_copy_bits(skb, skb->len - alen - 2, nexthdr, 2)) ret = skb_copy_bits(skb, skb->len - alen - 2, nexthdr, 2);
BUG(); BUG_ON(ret);
ret = -EINVAL; ret = -EINVAL;
padlen = nexthdr[0]; padlen = nexthdr[0];
...@@ -559,14 +559,14 @@ static void esp_input_restore_header(struct sk_buff *skb) ...@@ -559,14 +559,14 @@ static void esp_input_restore_header(struct sk_buff *skb)
static void esp_input_set_header(struct sk_buff *skb, __be32 *seqhi) static void esp_input_set_header(struct sk_buff *skb, __be32 *seqhi)
{ {
struct xfrm_state *x = xfrm_input_state(skb); struct xfrm_state *x = xfrm_input_state(skb);
struct ip_esp_hdr *esph = (struct ip_esp_hdr *)skb->data;
/* For ESN we move the header forward by 4 bytes to /* For ESN we move the header forward by 4 bytes to
* accomodate the high bits. We will move it back after * accomodate the high bits. We will move it back after
* decryption. * decryption.
*/ */
if ((x->props.flags & XFRM_STATE_ESN)) { if ((x->props.flags & XFRM_STATE_ESN)) {
esph = skb_push(skb, 4); struct ip_esp_hdr *esph = skb_push(skb, 4);
*seqhi = esph->spi; *seqhi = esph->spi;
esph->spi = esph->seq_no; esph->spi = esph->seq_no;
esph->seq_no = XFRM_SKB_CB(skb)->seq.input.hi; esph->seq_no = XFRM_SKB_CB(skb)->seq.input.hi;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment