[PATCH 1/3] ipvs: fix timer in get_curr_sync_buff

To: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, netfilter@xxxxxxxxxxxxxxx
Subject: [PATCH 1/3] ipvs: fix timer in get_curr_sync_buff
Cc: Julian Anastasov <ja@xxxxxx>, Patrick Schaaf <netdev@xxxxxx>, Patrick McHardy <kaber@xxxxxxxxx>, Tinggong Wang <wangtinggong@xxxxxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Wed, 16 Feb 2011 15:04:51 +0900
From: Tinggong Wang <wangtinggong@xxxxxxxxx>

        Fix get_curr_sync_buff to keep buffer for 2 seconds
as intended, not just for the current jiffie. By this way
we will sync more connection structures with single packet.

Signed-off-by: Tinggong Wang <wangtinggong@xxxxxxxxx>
Signed-off-by: Julian Anastasov <ja@xxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
 net/netfilter/ipvs/ip_vs_sync.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index d1b7298..fecf24d 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -374,8 +374,8 @@ get_curr_sync_buff(struct netns_ipvs *ipvs, unsigned long 
        struct ip_vs_sync_buff *sb;
-       if (ipvs->sync_buff && (time == 0 ||
-           time_before(jiffies - ipvs->sync_buff->firstuse, time))) {
+       if (ipvs->sync_buff &&
+           time_after_eq(jiffies - ipvs->sync_buff->firstuse, time)) {
                sb = ipvs->sync_buff;
                ipvs->sync_buff = NULL;
        } else

To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

<Prev in Thread] Current Thread [Next in Thread>