]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iplink: support setting addrgenmode stable_secret
authorBjørn Mork <bjorn@mork.no>
Mon, 4 Jan 2016 09:58:04 +0000 (10:58 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 6 Jan 2016 17:20:59 +0000 (09:20 -0800)
It is possible to switch to another addrgenmode after setting a
valid secret.  Allow switching back without reconfiguring the
secret for completeness.

Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
ip/iplink.c

index f30de86d1858a013b5ab8b9fd65bf61dd7a5a3ce..e824082f7d814971d20e25536f4fd52ae1a3cc3e 100644 (file)
@@ -84,7 +84,7 @@ void iplink_usage(void)
        fprintf(stderr, "                                  [ state { auto | enable | disable} ] ]\n");
        fprintf(stderr, "                         [ master DEVICE ]\n");
        fprintf(stderr, "                         [ nomaster ]\n");
-       fprintf(stderr, "                         [ addrgenmode { eui64 | none } ]\n");
+       fprintf(stderr, "                         [ addrgenmode { eui64 | none | stable_secret } ]\n");
        fprintf(stderr, "                         [ protodown { on | off } ]\n");
        fprintf(stderr, "       ip link show [ DEVICE | group GROUP ] [up] [master DEV] [type TYPE]\n");
 
@@ -176,6 +176,8 @@ static int get_addr_gen_mode(const char *mode)
                return IN6_ADDR_GEN_MODE_EUI64;
        if (strcasecmp(mode, "none") == 0)
                return IN6_ADDR_GEN_MODE_NONE;
+       if (strcasecmp(mode, "stable_secret") == 0)
+               return IN6_ADDR_GEN_MODE_STABLE_PRIVACY;
        return -1;
 }