gnunet-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-developers] [PATCH] New config option to disable NAT IP scanning


From: Corvus Corax
Subject: [GNUnet-developers] [PATCH] New config option to disable NAT IP scanning (not needed when configured with HOLE_EXTERNAL)
Date: Tue, 8 Oct 2019 20:20:12 +0200

---
 src/nat/gnunet-service-nat.c | 15 +++++++++++++--
 src/nat/nat.conf.in          |  3 +++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c
index 694949d..59a3403 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 a8dbee9..4c068c3 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
-- 
2.11.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]