summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-10-08 22:15:57 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-10-08 22:15:57 +0200
commit5682fc71092a9d64654d83b5c8b45520bd32459b (patch)
treee0e4ca390e00abfad521bde5f50140534c2525db
parent08b084003d06ea0db8fb645c4d30f5153a2af56e (diff)
allow to disable IP scan w/ HOLE_EXTERNAL; thanks Corvus Corax
-rw-r--r--src/nat/gnunet-service-nat.c15
-rw-r--r--src/nat/nat.conf.in3
2 files changed, 16 insertions, 2 deletions
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c
index 694949dde..59a340324 100644
--- a/src/nat/gnunet-service-nat.c
+++ b/src/nat/gnunet-service-nat.c
@@ -335,6 +335,11 @@ static struct StunExternalIP *se_tail;
*/
int enable_upnp;
+/**
+ * Is IP Scanning enabled? #GNUNET_YES if enabled, #GNUNET_NO if disabled,
+ * without, only explicitly specified IPs will be handled (HOLE_EXTERNAL)
+ */
+int enable_ipscan;
/**
* Remove and free an entry from the #lal_head DLL.
@@ -1939,12 +1944,18 @@ run (void *cls,
&dyndns_frequency))
dyndns_frequency = DYNDNS_FREQUENCY;
+ enable_ipscan
+ = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "NAT",
+ "ENABLE_IPSCAN");
+
GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
NULL);
stats = GNUNET_STATISTICS_create ("nat",
cfg);
- scan_task = GNUNET_SCHEDULER_add_now (&run_scan,
- NULL);
+ if (GNUNET_YES == enable_ipscan)
+ scan_task = GNUNET_SCHEDULER_add_now (&run_scan,
+ NULL);
}
diff --git a/src/nat/nat.conf.in b/src/nat/nat.conf.in
index a8dbee953..4c068c394 100644
--- a/src/nat/nat.conf.in
+++ b/src/nat/nat.conf.in
@@ -12,6 +12,9 @@ UNIX_MATCH_GID = YES
# Enable UPNP by default?
ENABLE_UPNP = YES
+# Enable scanning for all system IP addresses?
+ENABLE_IPSCAN = YES
+
# Disable IPv6 support
# FIXME: move entirely to transport plugins!
DISABLEV6 = NO