From e4a43ce6d372e0beab06503a97e8741eac4a5da8 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 9 Dec 2007 16:41:53 +0100 Subject: [PATCH] iptables plugin: Removed the `complain' stuff. --- src/iptables.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/iptables.c b/src/iptables.c index 5fa1f408..0e7fa70f 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -284,7 +284,7 @@ static void submit_chain( iptc_handle_t *handle, ip_chain_t *chain ) { static int iptables_read (void) { int i; - static complain_t complaint; + int num_failures = 0; /* Init the iptc handle structure and query the correct table */ for (i = 0; i < chain_num; i++) @@ -295,26 +295,24 @@ static int iptables_read (void) chain = chain_list[i]; if (!chain) { - DEBUG ("chain == NULL"); + DEBUG ("iptables plugin: chain == NULL"); continue; } - handle = iptc_init( chain->table ); + handle = iptc_init (chain->table); if (!handle) { - DEBUG ("iptc_init (%s) failed: %s", chain->table, iptc_strerror (errno)); - plugin_complain (LOG_ERR, &complaint, "iptc_init (%s) failed: %s", + ERROR ("iptables plugin: iptc_init (%s) failed: %s", chain->table, iptc_strerror (errno)); + num_failures++; continue; } - plugin_relief (LOG_INFO, &complaint, "iptc_init (%s) succeeded", - chain->table); submit_chain (&handle, chain); iptc_free (&handle); - } + } /* for (i = 0 .. chain_num) */ - return (0); + return ((num_failures < chain_num) ? 0 : -1); } /* int iptables_read */ static int iptables_shutdown (void) -- 2.11.0