Fix blacklistd's state restoral at startup
authorlidl <lidl@FreeBSD.org>
Fri, 30 Sep 2016 16:35:30 +0000 (16:35 +0000)
committerlidl <lidl@FreeBSD.org>
Fri, 30 Sep 2016 16:35:30 +0000 (16:35 +0000)
commitfcf0811818e99230d6736447c554b84f7412e087
tree4c42069f9df821d0112c50560a2b1593472e5724
parentba02108681283ebc09ad4dcb98b7865da3b7c278
Fix blacklistd's state restoral at startup

The blacklistd daemon attempted to restore the filtering rules
before the database of blocked addresses was opened, so no rules
were being reloaded.  Now the rules are properly recreated when the
daemon is started with '-r'.

This bug was fixed locally, and then sent upstream to NetBSD.
This changeset is the import the NetBSD version of the change,
which added debugging output to alert about a null database.

Reviewed by: emaste
Obtained from: NetBSD
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
contrib/blacklist/bin/blacklistd.c
contrib/blacklist/bin/state.c