* [PATCH iproute2 0/4] addrgenmode updates for net-next
@ 2016-01-04 9:58 Bjørn Mork
2016-01-04 9:58 ` [PATCH iproute2 1/4] include: update kernel headers Bjørn Mork
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Bjørn Mork @ 2016-01-04 9:58 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Hannes Frederic Sowa, netdev, Bjørn Mork
This adds support for the new "random" addrgenmode in net-next
and improves the support for the "stable_secret" mode.
Bjørn Mork (4):
include: update kernel headers
iplink: support setting addrgenmode stable_secret
iplink: support show and set of "addrgenmode random"
man: iplink: document new addrgenmodes
include/linux/if_link.h | 1 +
ip/ipaddress.c | 3 +++
ip/iplink.c | 6 +++++-
man/man8/ip-link.8.in | 18 +++++++++++++++---
4 files changed, 24 insertions(+), 4 deletions(-)
--
2.1.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH iproute2 1/4] include: update kernel headers
2016-01-04 9:58 [PATCH iproute2 0/4] addrgenmode updates for net-next Bjørn Mork
@ 2016-01-04 9:58 ` Bjørn Mork
2016-01-06 17:23 ` Stephen Hemminger
2016-01-04 9:58 ` [PATCH iproute2 2/4] iplink: support setting addrgenmode stable_secret Bjørn Mork
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Bjørn Mork @ 2016-01-04 9:58 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Hannes Frederic Sowa, netdev, Bjørn Mork
Import current if_link.h from net-next
Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
include/linux/if_link.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index c9ad487d04f0..d91f2c97d946 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -216,6 +216,7 @@ enum in6_addr_gen_mode {
IN6_ADDR_GEN_MODE_EUI64,
IN6_ADDR_GEN_MODE_NONE,
IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
+ IN6_ADDR_GEN_MODE_RANDOM,
};
/* Bridge section */
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH iproute2 2/4] iplink: support setting addrgenmode stable_secret
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-04 9:58 ` Bjørn Mork
2016-01-04 9:58 ` [PATCH iproute2 3/4] iplink: support show and set of "addrgenmode random" Bjørn Mork
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Bjørn Mork @ 2016-01-04 9:58 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Hannes Frederic Sowa, netdev, Bjørn Mork
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH iproute2 3/4] iplink: support show and set of "addrgenmode random"
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-04 9:58 ` [PATCH iproute2 2/4] iplink: support setting addrgenmode stable_secret Bjørn Mork
@ 2016-01-04 9:58 ` 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
4 siblings, 0 replies; 7+ messages in thread
From: Bjørn Mork @ 2016-01-04 9:58 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Hannes Frederic Sowa, netdev, Bjørn Mork
"random" is a new IPv6 addrgenmode, enabling "stable_secret" type
addresses with an auto-generated secret.
$ ip link set eth0 addrgenmode random
$ ip -d link show dev eth0
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether 00:21:86:a3:25:7d brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode random
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
ip/ipaddress.c | 3 +++
ip/iplink.c | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index a495a391a0ec..9d254d27bc1b 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -296,6 +296,9 @@ static void print_af_spec(FILE *fp, struct rtattr *af_spec_attr)
case IN6_ADDR_GEN_MODE_STABLE_PRIVACY:
fprintf(fp, "addrgenmode stable_secret ");
break;
+ case IN6_ADDR_GEN_MODE_RANDOM:
+ fprintf(fp, "addrgenmode random ");
+ break;
default:
fprintf(fp, "addrgenmode %#.2hhx ", mode);
break;
diff --git a/ip/iplink.c b/ip/iplink.c
index e824082f7d81..75b21540c6b5 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 | stable_secret } ]\n");
+ fprintf(stderr, " [ addrgenmode { eui64 | none | stable_secret | random } ]\n");
fprintf(stderr, " [ protodown { on | off } ]\n");
fprintf(stderr, " ip link show [ DEVICE | group GROUP ] [up] [master DEV] [type TYPE]\n");
@@ -178,6 +178,8 @@ static int get_addr_gen_mode(const char *mode)
return IN6_ADDR_GEN_MODE_NONE;
if (strcasecmp(mode, "stable_secret") == 0)
return IN6_ADDR_GEN_MODE_STABLE_PRIVACY;
+ if (strcasecmp(mode, "random") == 0)
+ return IN6_ADDR_GEN_MODE_RANDOM;
return -1;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH iproute2 4/4] man: iplink: document new addrgenmodes
2016-01-04 9:58 [PATCH iproute2 0/4] addrgenmode updates for net-next Bjørn Mork
` (2 preceding siblings ...)
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 ` Bjørn Mork
2016-01-06 17:23 ` [PATCH iproute2 0/4] addrgenmode updates for net-next Stephen Hemminger
4 siblings, 0 replies; 7+ messages in thread
From: Bjørn Mork @ 2016-01-04 9:58 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Hannes Frederic Sowa, netdev, Bjørn Mork
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
man/man8/ip-link.8.in | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index ac6f4813a329..189a8f15fa03 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -150,7 +150,7 @@ ip-link \- network device configuration
.br
.B nomaster " |"
.br
-.B addrgenmode { eui64 | none }
+.B addrgenmode { eui64 | none | stable_secret | random }
.br
.B link-netnsid ID
.BR " }"
@@ -1029,8 +1029,20 @@ set master device of the device (enslave device).
unset master device of the device (release device).
.TP
-.BR "addrgenmode eui64 " or " addrgenmode none"
-set IPv6 address generation mode
+.BI addrgenmode " eui64|none|stable_secret|random"
+set the IPv6 address generation mode
+
+.I eui64
+- use a Modified EUI-64 format interface identifier
+
+.I none
+- disable automatic address generation
+
+.I stable_secret
+- generate the interface identifier based on a preset /proc/sys/net/ipv6/conf/{default,DEVICE}/stable_secret
+
+.I random
+- like stable_secret, but auto-generate a new random secret if none is set
.TP
.BR "link-netnsid "
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH iproute2 1/4] include: update kernel headers
2016-01-04 9:58 ` [PATCH iproute2 1/4] include: update kernel headers Bjørn Mork
@ 2016-01-06 17:23 ` Stephen Hemminger
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2016-01-06 17:23 UTC (permalink / raw)
To: Bjørn Mork; +Cc: Hannes Frederic Sowa, netdev
On Mon, 4 Jan 2016 10:58:03 +0100
Bjørn Mork <bjorn@mork.no> wrote:
> Import current if_link.h from net-next
>
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
> ---
> include/linux/if_link.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/if_link.h b/include/linux/if_link.h
> index c9ad487d04f0..d91f2c97d946 100644
> --- a/include/linux/if_link.h
> +++ b/include/linux/if_link.h
> @@ -216,6 +216,7 @@ enum in6_addr_gen_mode {
> IN6_ADDR_GEN_MODE_EUI64,
> IN6_ADDR_GEN_MODE_NONE,
> IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
> + IN6_ADDR_GEN_MODE_RANDOM,
> };
>
> /* Bridge section */
I went ahead and updated all the net-next headers.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH iproute2 0/4] addrgenmode updates for net-next
2016-01-04 9:58 [PATCH iproute2 0/4] addrgenmode updates for net-next Bjørn Mork
` (3 preceding siblings ...)
2016-01-04 9:58 ` [PATCH iproute2 4/4] man: iplink: document new addrgenmodes Bjørn Mork
@ 2016-01-06 17:23 ` Stephen Hemminger
4 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2016-01-06 17:23 UTC (permalink / raw)
To: Bjørn Mork; +Cc: Hannes Frederic Sowa, netdev
On Mon, 4 Jan 2016 10:58:02 +0100
Bjørn Mork <bjorn@mork.no> wrote:
> This adds support for the new "random" addrgenmode in net-next
> and improves the support for the "stable_secret" mode.
>
> Bjørn Mork (4):
> include: update kernel headers
> iplink: support setting addrgenmode stable_secret
> iplink: support show and set of "addrgenmode random"
> man: iplink: document new addrgenmodes
>
> include/linux/if_link.h | 1 +
> ip/ipaddress.c | 3 +++
> ip/iplink.c | 6 +++++-
> man/man8/ip-link.8.in | 18 +++++++++++++++---
> 4 files changed, 24 insertions(+), 4 deletions(-)
>
Applied to net-next branch.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-01-06 17:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH iproute2 2/4] iplink: support setting addrgenmode stable_secret Bjørn Mork
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
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).