]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
tenants: apply added/removed tenant
authorVictor Julien <victor@inliniac.net>
Thu, 29 Jan 2015 10:33:11 +0000 (11:33 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 23 Jul 2015 17:36:14 +0000 (19:36 +0200)
Apply to the engine.

src/runmode-unix-socket.c

index 2e9a6c0f4174d9d4828db19a6fe77c433f2f66b7..2a0d651a2d8517771069ef6405ce66d1bb2b8a47 100644 (file)
@@ -479,6 +479,11 @@ TmEcode UnixSocketRegisterTenant(json_t *cmd, json_t* answer, void *data)
     DetectEngineAddToMaster(de_ctx);
 
     /* 3C for each thread, replace det_ctx */
+    if (DetectEngineMTApply() < 0) {
+        json_object_set_new(answer, "message", json_string("couldn't apply settings"));
+        // TODO cleanup
+        return TM_ECODE_FAILED;
+    }
 
     json_object_set_new(answer, "message", json_string("work in progress"));
     return TM_ECODE_OK;
@@ -519,7 +524,11 @@ TmEcode UnixSocketUnregisterTenant(json_t *cmd, json_t* answer, void *data)
     DetectEngineDeReference(&de_ctx);
 
     /* update the threads */
-    /** TODO */
+    if (DetectEngineMTApply() < 0) {
+        json_object_set_new(answer, "message", json_string("couldn't apply settings"));
+        // TODO cleanup
+        return TM_ECODE_FAILED;
+    }
 
     /* walk free list, freeing the removed de_ctx */
     DetectEnginePruneFreeList();