Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f18da47 authored by David S. Miller's avatar David S. Miller
Browse files


Steffen Klassert says:

====================
pull request (net-next): ipsec-next 2018-10-18

1) Remove an unnecessary dev->tstats check in xfrmi_get_stats64.
   From Li RongQing.

2) We currently do a sizeof(element) instead of a sizeof(array)
   check when initializing the ovec array of the secpath.
   Currently this array can have only one element, so code is
   OK but error-prone. Change this to do a sizeof(array)
   check so that we can add more elements in future.
   From Li RongQing.

3) Improve xfrm IPv6 address hashing by using the complete IPv6
   addresses for a hash. From Michal Kubecek.

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

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 82385b0d 8d4b6bce
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ static inline unsigned int __xfrm4_addr_hash(const xfrm_address_t *addr)

static inline unsigned int __xfrm6_addr_hash(const xfrm_address_t *addr)
{
	return ntohl(addr->a6[2] ^ addr->a6[3]);
	return jhash2((__force u32 *)addr->a6, 4, 0);
}

static inline unsigned int __xfrm4_daddr_saddr_hash(const xfrm_address_t *daddr,
@@ -26,8 +26,7 @@ static inline unsigned int __xfrm4_daddr_saddr_hash(const xfrm_address_t *daddr,
static inline unsigned int __xfrm6_daddr_saddr_hash(const xfrm_address_t *daddr,
						    const xfrm_address_t *saddr)
{
	return ntohl(daddr->a6[2] ^ daddr->a6[3] ^
		     saddr->a6[2] ^ saddr->a6[3]);
	return __xfrm6_addr_hash(daddr) ^ __xfrm6_addr_hash(saddr);
}

static inline u32 __bits2mask32(__u8 bits)
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ struct sec_path *secpath_dup(struct sec_path *src)
	sp->len = 0;
	sp->olen = 0;

	memset(sp->ovec, 0, sizeof(sp->ovec[XFRM_MAX_OFFLOAD_DEPTH]));
	memset(sp->ovec, 0, sizeof(sp->ovec));

	if (src) {
		int i;
+0 −3
Original line number Diff line number Diff line
@@ -561,9 +561,6 @@ static void xfrmi_get_stats64(struct net_device *dev,
{
	int cpu;

	if (!dev->tstats)
		return;

	for_each_possible_cpu(cpu) {
		struct pcpu_sw_netstats *stats;
		struct pcpu_sw_netstats tmp;