netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "Hannes Frederic Sowa" <hannes@stressinduktion.org>,
	netdev@vger.kernel.org, "Bjørn Mork" <bjorn@mork.no>
Subject: [PATCH iproute2 2/4] iplink: support setting addrgenmode stable_secret
Date: Mon,  4 Jan 2016 10:58:04 +0100	[thread overview]
Message-ID: <1451901486-3497-3-git-send-email-bjorn@mork.no> (raw)
In-Reply-To: <1451901486-3497-1-git-send-email-bjorn@mork.no>

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ip/iplink.c b/ip/iplink.c
index f30de86d1858..e824082f7d81 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -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;
 }
 
-- 
2.1.4

  parent reply	other threads:[~2016-01-04  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04  9:58 [PATCH iproute2 0/4] addrgenmode updates for net-next Bjørn Mork
2016-01-04  9:58 ` [PATCH iproute2 1/4] include: update kernel headers Bjørn Mork
2016-01-06 17:23   ` Stephen Hemminger
2016-01-04  9:58 ` Bjørn Mork [this message]
2016-01-04  9:58 ` [PATCH iproute2 3/4] iplink: support show and set of "addrgenmode random" Bjørn Mork
2016-01-04  9:58 ` [PATCH iproute2 4/4] man: iplink: document new addrgenmodes Bjørn Mork
2016-01-06 17:23 ` [PATCH iproute2 0/4] addrgenmode updates for net-next Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451901486-3497-3-git-send-email-bjorn@mork.no \
    --to=bjorn@mork.no \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).