2017-04-12 20:38:24

by Aaron Conole

[permalink] [raw]
Subject: [PATCH nf-next] ip_vs_sync: change comparison on sync_refresh_period

The sync_refresh_period variable is unsigned, so it can never be < 0.

Signed-off-by: Aaron Conole <[email protected]>
---
net/netfilter/ipvs/ip_vs_sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index b03c280..123dc0f 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -520,7 +520,7 @@ static int ip_vs_sync_conn_needed(struct netns_ipvs *ipvs,
if (!(cp->flags & IP_VS_CONN_F_TEMPLATE) &&
pkts % sync_period != sysctl_sync_threshold(ipvs))
return 0;
- } else if (sync_refresh_period <= 0 &&
+ } else if (!sync_refresh_period &&
pkts != sysctl_sync_threshold(ipvs))
return 0;

--
2.9.3


2017-04-12 22:48:18

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH nf-next] ip_vs_sync: change comparison on sync_refresh_period

On Wed, Apr 12, 2017 at 04:38:12PM -0400, Aaron Conole wrote:
> The sync_refresh_period variable is unsigned, so it can never be < 0.
>
> Signed-off-by: Aaron Conole <[email protected]>

Thanks Aaron,

I have applied this to ipvs-next after updating the prefix to "ipvs:".