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++)
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)