netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [conntrack-tools PATCH 1/2] conntrackd: consolidate more code to use resync_send()
@ 2017-05-09  7:41 Arturo Borrero Gonzalez
  2017-05-09  7:41 ` [conntrack-tools PATCH 2/2] conntrackd: request resync at startup Arturo Borrero Gonzalez
  2017-05-15 16:21 ` [conntrack-tools PATCH 1/2] conntrackd: consolidate more code to use resync_send() Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2017-05-09  7:41 UTC (permalink / raw)
  To: netfilter-devel

These digest_msg() functions can use resync_send() as well.

While at it, bring back a call to kernel_resync() in notrack_local() which was
lost in a previous commit.

Fixes: 131df891f77dc75515d5eabdedd9818105d29f5a ("conntrackd: factorize resync operations")
Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
---
 src/sync-ftfw.c    |    5 +----
 src/sync-notrack.c |   15 +++++++--------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/sync-ftfw.c b/src/sync-ftfw.c
index 6fdb058..6dca3dc 100644
--- a/src/sync-ftfw.c
+++ b/src/sync-ftfw.c
@@ -313,10 +313,7 @@ static int digest_msg(const struct nethdr *net)
 
 	} else if (IS_RESYNC(net)) {
 		dlog(LOG_NOTICE, "resync requested by other node");
-		cache_iterate(STATE(mode)->internal->ct.data, NULL,
-			      do_cache_to_tx);
-		cache_iterate(STATE(mode)->internal->exp.data, NULL,
-			      do_cache_to_tx);
+		resync_send(do_cache_to_tx);
 		return MSG_CTL;
 
 	} else if (IS_ALIVE(net))
diff --git a/src/sync-notrack.c b/src/sync-notrack.c
index 7ce62d9..1b53e1b 100644
--- a/src/sync-notrack.c
+++ b/src/sync-notrack.c
@@ -107,7 +107,10 @@ static int notrack_local(int fd, int type, void *data)
 		resync_req();
 		break;
 	case SEND_BULK:
-		resync_send(do_cache_to_tx);
+		if (CONFIG(sync).internal_cache_disable)
+			kernel_resync();
+		else
+			resync_send(do_cache_to_tx);
 		break;
 	default:
 		ret = 0;
@@ -124,14 +127,10 @@ static int digest_msg(const struct nethdr *net)
 
 	if (IS_RESYNC(net)) {
 		dlog(LOG_NOTICE, "resync requested by other node");
-		if (CONFIG(sync).internal_cache_disable) {
+		if (CONFIG(sync).internal_cache_disable)
 			kernel_resync();
-		} else {
-			cache_iterate(STATE(mode)->internal->ct.data,
-				      NULL, do_cache_to_tx);
-			cache_iterate(STATE(mode)->internal->exp.data,
-				      NULL, do_cache_to_tx);
-		}
+		else
+			resync_send(do_cache_to_tx);
 		return MSG_CTL;
 	}
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-15 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-09  7:41 [conntrack-tools PATCH 1/2] conntrackd: consolidate more code to use resync_send() Arturo Borrero Gonzalez
2017-05-09  7:41 ` [conntrack-tools PATCH 2/2] conntrackd: request resync at startup Arturo Borrero Gonzalez
2017-05-15 16:22   ` Pablo Neira Ayuso
2017-05-15 16:21 ` [conntrack-tools PATCH 1/2] conntrackd: consolidate more code to use resync_send() Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).