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

Commit 16a7fd32 authored by Tinggong Wang's avatar Tinggong Wang Committed by Simon Horman
Browse files

ipvs: fix timer in get_curr_sync_buff



 	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: default avatarTinggong Wang <wangtinggong@gmail.com>
Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 8248779b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -374,8 +374,8 @@ get_curr_sync_buff(struct netns_ipvs *ipvs, unsigned long time)
	struct ip_vs_sync_buff *sb;
	struct ip_vs_sync_buff *sb;


	spin_lock_bh(&ipvs->sync_buff_lock);
	spin_lock_bh(&ipvs->sync_buff_lock);
	if (ipvs->sync_buff && (time == 0 ||
	if (ipvs->sync_buff &&
	    time_before(jiffies - ipvs->sync_buff->firstuse, time))) {
	    time_after_eq(jiffies - ipvs->sync_buff->firstuse, time)) {
		sb = ipvs->sync_buff;
		sb = ipvs->sync_buff;
		ipvs->sync_buff = NULL;
		ipvs->sync_buff = NULL;
	} else
	} else