Skip to content
Snippets Groups Projects
Commit f1e663db authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

FWUp: Log queue manipulation and the ipset commands

parent 4bef2eab
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ struct queue *queue_alloc(struct context *context) {
}
static void start(struct context *context, struct queue *queue) {
ulog(LLOG_DEBUG, "Starting ipset subcommand\n");
assert(!queue->active);
int pipes[2];
sanity(pipe(pipes) != -1, "Couldn't create FWUp pipe: %s\n", strerror(errno));
......@@ -87,6 +88,8 @@ static void lost(struct context *context, struct queue *queue, bool error) {
assert(queue->active);
if (error)
ulog(LLOG_WARN, "Lost connection to ipset command %d, data may be out of sync\n", queue->pid);
else
ulog(LLOG_DEBUG, "Closing ipset subcommand\n");
sanity(close(queue->ipset_pipe) == 0, "Error closing the ipset pipe: %s\n", strerror(errno));
loop_plugin_unregister_fd(context, queue->ipset_pipe);
queue->ipset_pipe = 0;
......@@ -107,6 +110,7 @@ static void flush_timeout(struct context *context, void *data, size_t id __attri
void enqueue(struct context *context, struct queue *queue, const char *command) {
if (!queue->active)
start(context, queue);
ulog(LLOG_DEBUG_VERBOSE, "IPset command %s\n", command);
assert(queue->active);
assert(queue->ipset_pipe > 0);
size_t len = strlen(command);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment