aboutsummaryrefslogtreecommitdiff
path: root/src/nat-auto
diff options
context:
space:
mode:
Diffstat (limited to 'src/nat-auto')
-rw-r--r--src/nat-auto/gnunet-nat-auto.c25
1 files changed, 12 insertions, 13 deletions
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,
174 GNUNET_NAT_AUTO_status2string (result), 174 GNUNET_NAT_AUTO_status2string (result),
175 nat_type); 175 nat_type);
176 176
177 if (NULL == diff)
178 return;
179
177 /* Shortcut: if there are no changes suggested, bail out early. */ 180 /* Shortcut: if there are no changes suggested, bail out early. */
178 if (GNUNET_NO == 181 if (GNUNET_NO ==
179 GNUNET_CONFIGURATION_is_dirty (diff)) 182 GNUNET_CONFIGURATION_is_dirty (diff))
@@ -186,20 +189,16 @@ auto_config_cb (void *cls,
186 to the user */ 189 to the user */
187 new_cfg = write_cfg ? GNUNET_CONFIGURATION_dup (cfg) : NULL; 190 new_cfg = write_cfg ? GNUNET_CONFIGURATION_dup (cfg) : NULL;
188 191
189 if (NULL != diff) 192 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
190 { 193 _("Suggested configuration changes:\n"));
191 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 194 GNUNET_CONFIGURATION_iterate_section_values (diff,
192 _("Suggested configuration changes:\n")); 195 "nat",
193 GNUNET_CONFIGURATION_iterate_section_values (diff, 196 &auto_conf_iter,
194 "nat", 197 new_cfg);
195 &auto_conf_iter,
196 new_cfg);
197 }
198 198
199 /* If desired, write configuration to file; we write only the 199 /* If desired, write configuration to file; we write only the
200 changes to the defaults to keep things compact. */ 200 changes to the defaults to keep things compact. */
201 if ( (write_cfg) && 201 if (write_cfg)
202 (NULL != diff) )
203 { 202 {
204 struct GNUNET_CONFIGURATION_Handle *def_cfg; 203 struct GNUNET_CONFIGURATION_Handle *def_cfg;
205 204
@@ -298,8 +297,8 @@ run (void *cls,
298 if (do_auto) 297 if (do_auto)
299 { 298 {
300 ah = GNUNET_NAT_AUTO_autoconfig_start (c, 299 ah = GNUNET_NAT_AUTO_autoconfig_start (c,
301 &auto_config_cb, 300 &auto_config_cb,
302 NULL); 301 NULL);
303 } 302 }
304 303
305 if (use_tcp && use_udp) 304 if (use_tcp && use_udp)