#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
-#include "gnunet_directories.h"
+#include "gnunet_constants.h"
#include "gnunet_resolver_service.h"
#if HAVE_MALLINFO
*
* @param list a list of networks
* @param add the IP to check (in network byte order)
- * @return GNUNET_NO if the IP is not in the list, GNUNET_YES if it it is
+ * @return #GNUNET_NO if the IP is not in the list, #GNUNET_YES if it it is
*/
static int
-check_ipv4_listed (const struct GNUNET_STRINGS_IPv4NetworkPolicy *list, const struct in_addr *add)
+check_ipv4_listed (const struct GNUNET_STRINGS_IPv4NetworkPolicy *list,
+ const struct in_addr *add)
{
unsigned int i;
*
* @param list a list of networks
* @param ip the IP to check (in network byte order)
- * @return GNUNET_NO if the IP is not in the list, GNUNET_YES if it it is
+ * @return #GNUNET_NO if the IP is not in the list, #GNUNET_YES if it it is
*/
static int
-check_ipv6_listed (const struct GNUNET_STRINGS_IPv6NetworkPolicy *list, const struct in6_addr *ip)
+check_ipv6_listed (const struct GNUNET_STRINGS_IPv6NetworkPolicy *list,
+ const struct in6_addr *ip)
{
unsigned int i;
unsigned int j;
HANDLE_ERROR;
if (NULL == opt_cfg_fn)
opt_cfg_fn = GNUNET_strdup (cfg_fn);
- if (GNUNET_YES ==
- GNUNET_DISK_file_test (opt_cfg_fn))
- (void) GNUNET_CONFIGURATION_load (cfg, opt_cfg_fn);
+ if (GNUNET_YES == GNUNET_DISK_file_test (opt_cfg_fn))
+ {
+ if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, opt_cfg_fn))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Malformed configuration file `%s', exit ...\n"),
+ opt_cfg_fn);
+ goto shutdown;
+ }
+ }
else
{
- (void) GNUNET_CONFIGURATION_load (cfg, NULL);
+ if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, NULL))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Malformed configuration, exit ...\n"));
+ goto shutdown;
+ }
if (0 != strcmp (opt_cfg_fn, cfg_fn))
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Could not access configuration file `%s'\n"),
GNUNET_free_non_null (logfile);
GNUNET_free_non_null (loglev);
GNUNET_free (cfg_fn);
- GNUNET_free (opt_cfg_fn);
+ GNUNET_free_non_null (opt_cfg_fn);
GNUNET_free_non_null (sctx.v4_denied);
GNUNET_free_non_null (sctx.v6_denied);
GNUNET_free_non_null (sctx.v4_allowed);