|
|
f2ca2f |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
|
|
|
f2ca2f |
index fadef0f..39cb62c 100644
|
|
|
f2ca2f |
--- a/include/linux/if_link.h
|
|
|
f2ca2f |
+++ b/include/linux/if_link.h
|
|
|
f2ca2f |
@@ -202,11 +202,17 @@ enum {
|
|
|
f2ca2f |
IFLA_INET6_CACHEINFO, /* time values and max reasm size */
|
|
|
f2ca2f |
IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
|
|
|
f2ca2f |
IFLA_INET6_TOKEN, /* device token */
|
|
|
f2ca2f |
+ IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
|
|
|
f2ca2f |
__IFLA_INET6_MAX
|
|
|
f2ca2f |
};
|
|
|
f2ca2f |
|
|
|
f2ca2f |
#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
|
|
|
f2ca2f |
|
|
|
f2ca2f |
+enum in6_addr_gen_mode {
|
|
|
f2ca2f |
+ IN6_ADDR_GEN_MODE_EUI64,
|
|
|
f2ca2f |
+ IN6_ADDR_GEN_MODE_NONE,
|
|
|
f2ca2f |
+};
|
|
|
f2ca2f |
+
|
|
|
f2ca2f |
enum {
|
|
|
f2ca2f |
BRIDGE_MODE_UNSPEC,
|
|
|
f2ca2f |
BRIDGE_MODE_HAIRPIN,
|
|
|
f2ca2f |
diff --git a/ip/iplink.c b/ip/iplink.c
|
|
|
f2ca2f |
index 0d020ef..ecb05d6 100644
|
|
|
f2ca2f |
--- a/ip/iplink.c
|
|
|
f2ca2f |
+++ b/ip/iplink.c
|
|
|
f2ca2f |
@@ -81,6 +81,7 @@ void iplink_usage(void)
|
|
|
f2ca2f |
fprintf(stderr, " [ state { auto | enable | disable} ] ]\n");
|
|
|
f2ca2f |
fprintf(stderr, " [ master DEVICE ]\n");
|
|
|
f2ca2f |
fprintf(stderr, " [ nomaster ]\n");
|
|
|
f2ca2f |
+ fprintf(stderr, " [ addrgenmode { eui64 | none } ]\n");
|
|
|
f2ca2f |
fprintf(stderr, " ip link show [ DEVICE | group GROUP ] [up]\n");
|
|
|
f2ca2f |
|
|
|
f2ca2f |
if (iplink_have_newlink()) {
|
|
|
f2ca2f |
@@ -161,6 +162,15 @@ static int get_link_mode(const char *mode)
|
|
|
f2ca2f |
return -1;
|
|
|
f2ca2f |
}
|
|
|
f2ca2f |
|
|
|
f2ca2f |
+static int get_addr_gen_mode(const char *mode)
|
|
|
f2ca2f |
+{
|
|
|
f2ca2f |
+ if (strcasecmp(mode, "eui64") == 0)
|
|
|
f2ca2f |
+ return IN6_ADDR_GEN_MODE_EUI64;
|
|
|
f2ca2f |
+ if (strcasecmp(mode, "none") == 0)
|
|
|
f2ca2f |
+ return IN6_ADDR_GEN_MODE_NONE;
|
|
|
f2ca2f |
+ return -1;
|
|
|
f2ca2f |
+}
|
|
|
f2ca2f |
+
|
|
|
f2ca2f |
#if IPLINK_IOCTL_COMPAT
|
|
|
f2ca2f |
static int have_rtnl_newlink = -1;
|
|
|
f2ca2f |
|
|
|
f2ca2f |
@@ -557,6 +567,18 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
|
|
|
f2ca2f |
invarg("Invalid \"numrxqueues\" value\n", *argv);
|
|
|
f2ca2f |
addattr_l(&req->n, sizeof(*req), IFLA_NUM_RX_QUEUES,
|
|
|
f2ca2f |
&numrxqueues, 4);
|
|
|
f2ca2f |
+ } else if (matches(*argv, "addrgenmode") == 0) {
|
|
|
f2ca2f |
+ struct rtattr *afs, *afs6;
|
|
|
f2ca2f |
+ int mode;
|
|
|
f2ca2f |
+ NEXT_ARG();
|
|
|
f2ca2f |
+ mode = get_addr_gen_mode(*argv);
|
|
|
f2ca2f |
+ if (mode < 0)
|
|
|
f2ca2f |
+ invarg("Invalid address generation mode\n", *argv);
|
|
|
f2ca2f |
+ afs = addattr_nest(&req->n, sizeof(*req), IFLA_AF_SPEC);
|
|
|
f2ca2f |
+ afs6 = addattr_nest(&req->n, sizeof(*req), AF_INET6);
|
|
|
f2ca2f |
+ addattr8(&req->n, sizeof(*req), IFLA_INET6_ADDR_GEN_MODE, mode);
|
|
|
f2ca2f |
+ addattr_nest_end(&req->n, afs6);
|
|
|
f2ca2f |
+ addattr_nest_end(&req->n, afs);
|
|
|
f2ca2f |
} else {
|
|
|
f2ca2f |
if (strcmp(*argv, "dev") == 0) {
|
|
|
f2ca2f |
NEXT_ARG();
|
|
|
f2ca2f |
diff -uNrp iproute2-3.10.0.orig/man/man8/ip-link.8.in iproute2-3.10.0/man/man8/ip-link.8.in
|
|
|
f2ca2f |
--- iproute2-3.10.0.orig/man/man8/ip-link.8.in 2014-10-24 12:59:52.388574153 +0200
|
|
|
f2ca2f |
+++ iproute2-3.10.0/man/man8/ip-link.8.in 2014-10-24 12:57:58.650081739 +0200
|
|
|
f2ca2f |
@@ -120,9 +120,11 @@ ip-link \- network device configuration
|
|
|
f2ca2f |
] |
|
|
|
f2ca2f |
.br
|
|
|
f2ca2f |
.B master
|
|
|
f2ca2f |
-.IR DEVICE
|
|
|
f2ca2f |
+.IR DEVICE " |"
|
|
|
f2ca2f |
.br
|
|
|
f2ca2f |
-.B nomaster
|
|
|
f2ca2f |
+.B nomaster " |"
|
|
|
f2ca2f |
+.br
|
|
|
f2ca2f |
+.B addrgenmode { eui64 | none }
|
|
|
f2ca2f |
.BR " }"
|
|
|
f2ca2f |
|
|
|
f2ca2f |
|
|
|
f2ca2f |
@@ -512,6 +514,10 @@ set master device of the device (enslave
|
|
|
f2ca2f |
.BI nomaster
|
|
|
f2ca2f |
unset master device of the device (release device).
|
|
|
f2ca2f |
|
|
|
f2ca2f |
+.TP
|
|
|
f2ca2f |
+.BR "addrgenmode eui64 " or " addrgenmode none"
|
|
|
f2ca2f |
+set IPv6 address generation mode
|
|
|
f2ca2f |
+
|
|
|
f2ca2f |
.PP
|
|
|
f2ca2f |
.B Warning:
|
|
|
f2ca2f |
If multiple parameter changes are requested,
|