Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 2018-03-29

1) Remove a redundant pointer initialization esp_input_set_header().
From Colin Ian King.

2) Mark the xfrm kmem_caches as __ro_after_init.
From Alexey Dobriyan.

3) Do the checksum for an ipsec offlad packet in software
if the device does not advertise NETIF_F_HW_ESP_TX_CSUM.
From Shannon Nelson.

4) Use booleans for true and false instead of integers
in xfrm_policy_cache_flush().
From Gustavo A. R. Silva

Please pull or let me know if there are problems.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+9 -4
+1 -1
net/ipv4/esp4.c
··· 654 654 static void esp_input_set_header(struct sk_buff *skb, __be32 *seqhi) 655 655 { 656 656 struct xfrm_state *x = xfrm_input_state(skb); 657 - struct ip_esp_hdr *esph = (struct ip_esp_hdr *)skb->data; 657 + struct ip_esp_hdr *esph; 658 658 659 659 /* For ESN we move the header forward by 4 bytes to 660 660 * accomodate the high bits. We will move it back after
+2
net/ipv4/esp4_offload.c
··· 138 138 if (!(features & NETIF_F_HW_ESP) || !x->xso.offload_handle || 139 139 (x->xso.dev != skb->dev)) 140 140 esp_features = features & ~(NETIF_F_SG | NETIF_F_CSUM_MASK); 141 + else if (!(features & NETIF_F_HW_ESP_TX_CSUM)) 142 + esp_features = features & ~NETIF_F_CSUM_MASK; 141 143 142 144 xo->flags |= XFRM_GSO_SEGMENT; 143 145
+2
net/ipv6/esp6_offload.c
··· 165 165 if (!(features & NETIF_F_HW_ESP) || !x->xso.offload_handle || 166 166 (x->xso.dev != skb->dev)) 167 167 esp_features = features & ~(NETIF_F_SG | NETIF_F_CSUM_MASK); 168 + else if (!(features & NETIF_F_HW_ESP_TX_CSUM)) 169 + esp_features = features & ~NETIF_F_CSUM_MASK; 168 170 169 171 xo->flags |= XFRM_GSO_SEGMENT; 170 172
+2 -1
net/xfrm/xfrm_input.c
··· 9 9 */ 10 10 11 11 #include <linux/bottom_half.h> 12 + #include <linux/cache.h> 12 13 #include <linux/interrupt.h> 13 14 #include <linux/slab.h> 14 15 #include <linux/module.h> ··· 32 31 33 32 #define XFRM_TRANS_SKB_CB(__skb) ((struct xfrm_trans_cb *)&((__skb)->cb[0])) 34 33 35 - static struct kmem_cache *secpath_cachep __read_mostly; 34 + static struct kmem_cache *secpath_cachep __ro_after_init; 36 35 37 36 static DEFINE_SPINLOCK(xfrm_input_afinfo_lock); 38 37 static struct xfrm_input_afinfo const __rcu *xfrm_input_afinfo[AF_INET6 + 1];
+2 -2
net/xfrm/xfrm_policy.c
··· 51 51 static struct xfrm_policy_afinfo const __rcu *xfrm_policy_afinfo[AF_INET6 + 1] 52 52 __read_mostly; 53 53 54 - static struct kmem_cache *xfrm_dst_cache __read_mostly; 54 + static struct kmem_cache *xfrm_dst_cache __ro_after_init; 55 55 static __read_mostly seqcount_t xfrm_policy_hash_generation; 56 56 57 57 static void xfrm_init_pmtu(struct xfrm_dst **bundle, int nr); ··· 1743 1743 void xfrm_policy_cache_flush(void) 1744 1744 { 1745 1745 struct xfrm_dst *old; 1746 - bool found = 0; 1746 + bool found = false; 1747 1747 int cpu; 1748 1748 1749 1749 might_sleep();