document and accept correct spelling of 'preferred'
note that the incorrect spelling 'prefered' is still
returned to keep API stable (as documented in doc/service-api.txt)

follow-up, see http://comments.gmane.org/gmane.linux.network.connman/11306

Signed-off-by: Peter Meerwald <[email protected]>
Cc: Patrik Flykt <[email protected]>
---
 client/commands.c     | 2 +-
 doc/config-format.txt | 2 +-
 src/ipconfig.c        | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/client/commands.c b/client/commands.c
index 02c58c1..db460fd 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -1428,7 +1428,7 @@ static struct connman_option config_options[] = {
        {"nameservers", 'n', "<dns1> [<dns2>] [<dns3>]"},
        {"timeservers", 't', "<ntp1> [<ntp2>] [...]"},
        {"domains", 'd', "<domain1> [<domain2>] [...]"},
-       {"ipv6", 'v', "off|auto [enable|disable|prefered]|\n"
+       {"ipv6", 'v', "off|auto [enable|disable|preferred]|\n"
                      "\t\t\tmanual <address> <prefixlength> <gateway>"},
        {"proxy", 'x', "direct|auto <URL>|manual <URL1> [<URL2>] [...]\n"
                       "\t\t\t[exclude <exclude1> [<exclude2>] [...]]"},
diff --git a/doc/config-format.txt b/doc/config-format.txt
index 66fe1be..1d1235e 100644
--- a/doc/config-format.txt
+++ b/doc/config-format.txt
@@ -46,7 +46,7 @@ Allowed fields:
   If the setting is "auto", then SLAAC or DHCPv6 is used.
   Example: 2001:db8::2/64/2001:db8::1
 - IPv6.Privacy: IPv6 privacy option. Value can be either "disabled",
-  "enabled" or "prefered". See use_tempaddr variable description in Linux
+  "enabled" or "preferred". See use_tempaddr variable description in Linux
   kernel Documentation/networking/ip-sysctl.txt file.
 - MAC: MAC address of the interface where this setting should be applied.
   The MAC address is optional and if it is missing, then the first found
diff --git a/src/ipconfig.c b/src/ipconfig.c
index 8e310d9..c8c5a75 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -1753,6 +1753,8 @@ static int string2privacy(const char *privacy)
                return 0;
        else if (g_strcmp0(privacy, "enabled") == 0)
                return 1;
+       else if (g_strcmp0(privacy, "preferred") == 0)
+               return 2;
        else if (g_strcmp0(privacy, "prefered") == 0)
                return 2;
        else
-- 
1.8.3.4

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

Reply via email to