The 6to4 protocol as deployed on the public internet has been shown to
cause severe connectivity problems. RFC 6343 section 4.1 therefore
recommends against host implementations enabling it by default. This
patch implements that recommendation by introducing a new "Enable6to4"
configuration option, which defaults to false.

Due to the operational problems described in RFC 6343 section 3, the
IETF is about to deprecate the 6to4 protocol completely. This is done in
the document draft-ietf-v6ops-6to4-to-historic which is currently in the
RFC Editor's queue, pending final pulication as an RFC. Section 4 of
this document reinforces and strengthens RFC 6343's current
recommendation, mandating that hosts MUST disable 6to4 by default.
---
 doc/connman.conf.5 |  5 +++++
 src/dhcp.c         |  3 ++-
 src/main.c         | 14 ++++++++++++++
 src/main.conf      |  6 ++++++
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/doc/connman.conf.5 b/doc/connman.conf.5
index 626edfd..c1ca75c 100644
--- a/doc/connman.conf.5
+++ b/doc/connman.conf.5
@@ -126,5 +126,10 @@ really know what you are doing.
 Restore earlier tethering status when returning from offline mode,
 re-enabling a technology, and after restarts and reboots.
 Default value is false.
+.TP
+.B Enable6to4=\fPtrue|false\fP
+Automatically enable Anycast 6to4 if possible. This is not recommended, as the
+use of 6to4 will generally lead to a severe degradation of connection quality.
+See RFC6343.  Default value is false (as recommended by RFC6343 section 4.1).
 .SH "SEE ALSO"
 .BR Connman (8)
diff --git a/src/dhcp.c b/src/dhcp.c
index 09f462b..9a74362 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -399,7 +399,8 @@ static bool apply_lease_available_on_network(GDHCPClient 
*dhcp_client,
                                                                dhcp->pac);
        }
 
-       __connman_6to4_probe(service);
+       if (connman_setting_get_bool("Enable6to4"))
+               __connman_6to4_probe(service);
 
        return true;
 }
diff --git a/src/main.c b/src/main.c
index 1c17991..54476dc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -73,6 +73,7 @@ static struct {
        bool single_tech;
        char **tethering_technologies;
        bool persistent_tethering_mode;
+       bool enable_6to4;
 } connman_settings  = {
        .bg_scan = true,
        .pref_timeservers = NULL,
@@ -86,6 +87,7 @@ static struct {
        .single_tech = false,
        .tethering_technologies = NULL,
        .persistent_tethering_mode = false,
+       .enable_6to4 = false,
 };
 
 #define CONF_BG_SCAN                    "BackgroundScanning"
@@ -100,6 +102,7 @@ static struct {
 #define CONF_SINGLE_TECH                "SingleConnectedTechnology"
 #define CONF_TETHERING_TECHNOLOGIES      "TetheringTechnologies"
 #define CONF_PERSISTENT_TETHERING_MODE  "PersistentTetheringMode"
+#define CONF_ENABLE_6TO4                "Enable6to4"
 
 static const char *supported_options[] = {
        CONF_BG_SCAN,
@@ -114,6 +117,7 @@ static const char *supported_options[] = {
        CONF_SINGLE_TECH,
        CONF_TETHERING_TECHNOLOGIES,
        CONF_PERSISTENT_TETHERING_MODE,
+       CONF_ENABLE_6TO4,
        NULL
 };
 
@@ -354,6 +358,13 @@ static void parse_config(GKeyFile *config)
                connman_settings.persistent_tethering_mode = boolean;
 
        g_clear_error(&error);
+
+       boolean = __connman_config_get_bool(config, "General",
+                                       CONF_ENABLE_6TO4, &error);
+       if (!error)
+               connman_settings.enable_6to4 = boolean;
+
+       g_clear_error(&error);
 }
 
 static int config_init(const char *file)
@@ -528,6 +539,9 @@ bool connman_setting_get_bool(const char *key)
        if (g_str_equal(key, CONF_PERSISTENT_TETHERING_MODE))
                return connman_settings.persistent_tethering_mode;
 
+       if (g_str_equal(key, CONF_ENABLE_6TO4))
+               return connman_settings.enable_6to4;
+
        return false;
 }
 
diff --git a/src/main.conf b/src/main.conf
index 93c7a50..eb352fb 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -95,3 +95,9 @@
 # re-enabling a technology, and after restarts and reboots.
 # Default value is false.
 # PersistentTetheringMode = false
+
+# Automatically enable Anycast 6to4 if possible. This is not recommended, as
+# the use of 6to4 will generally lead to a severe degradation of connection
+# quality. See RFC6343. Default value is false (as recommended by RFC6343
+# section 4.1).
+# Enable6to4 = false
-- 
2.1.0

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to