summaryrefslogtreecommitdiffstats
path: root/src/sync-notrack.c
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo@debian.org>2017-04-20 19:28:11 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-05-08 19:50:28 +0200
commit131df891f77dc75515d5eabdedd9818105d29f5a (patch)
treef3796e75c40ebd4ac63d0a1d013934b358d22abf /src/sync-notrack.c
parent381827a8152d27d8afe92a914968b814ec9ac155 (diff)
conntrackd: factorize resync operations
Resync operations factorization. There are two: * resync_send --> conntrackd -B (send bulk resync) * resync_req --> conntrackd -n (request resync) Future patches reuse this factorized code. Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/sync-notrack.c')
-rw-r--r--src/sync-notrack.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/sync-notrack.c b/src/sync-notrack.c
index 5b6814d..7ce62d9 100644
--- a/src/sync-notrack.c
+++ b/src/sync-notrack.c
@@ -25,6 +25,7 @@
#include "log.h"
#include "cache.h"
#include "fds.h"
+#include "resync.h"
#include <string.h>
@@ -103,19 +104,10 @@ static int notrack_local(int fd, int type, void *data)
switch(type) {
case REQUEST_DUMP:
- dlog(LOG_NOTICE, "request resync");
- tx_queue_add_ctlmsg(NET_F_RESYNC, 0, 0);
+ resync_req();
break;
case SEND_BULK:
- dlog(LOG_NOTICE, "sending bulk update");
- 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);
- }
+ resync_send(do_cache_to_tx);
break;
default:
ret = 0;