X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fnat-auto%2Fgnunet-nat-auto.c;h=5eb0a4be3fe93d4c95db5e3a2cc1bb82fc0fc52c;hb=79fb947eb8fba243ea65e19b40b65e04f8806865;hp=9ba81eb5f17f379bd1eddb5be49cf02a09122289;hpb=07c8655e1ee8aa603def55b018222f3244235d1e;p=oweals%2Fgnunet.git diff --git a/src/nat-auto/gnunet-nat-auto.c b/src/nat-auto/gnunet-nat-auto.c index 9ba81eb5f..5eb0a4be3 100644 --- a/src/nat-auto/gnunet-nat-auto.c +++ b/src/nat-auto/gnunet-nat-auto.c @@ -174,6 +174,9 @@ auto_config_cb (void *cls, GNUNET_NAT_AUTO_status2string (result), nat_type); + if (NULL == diff) + return; + /* Shortcut: if there are no changes suggested, bail out early. */ if (GNUNET_NO == GNUNET_CONFIGURATION_is_dirty (diff)) @@ -186,20 +189,16 @@ auto_config_cb (void *cls, to the user */ new_cfg = write_cfg ? GNUNET_CONFIGURATION_dup (cfg) : NULL; - if (NULL != diff) - { - GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, - _("Suggested configuration changes:\n")); - GNUNET_CONFIGURATION_iterate_section_values (diff, - "nat", - &auto_conf_iter, - new_cfg); - } + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, + _("Suggested configuration changes:\n")); + GNUNET_CONFIGURATION_iterate_section_values (diff, + "nat", + &auto_conf_iter, + new_cfg); /* If desired, write configuration to file; we write only the changes to the defaults to keep things compact. */ - if ( (write_cfg) && - (NULL != diff) ) + if (write_cfg) { struct GNUNET_CONFIGURATION_Handle *def_cfg; @@ -298,8 +297,8 @@ run (void *cls, if (do_auto) { ah = GNUNET_NAT_AUTO_autoconfig_start (c, - &auto_config_cb, - NULL); + &auto_config_cb, + NULL); } if (use_tcp && use_udp)