vxcan,veth: Forbid "type" for peer device

It is already given for original device we configure this
peer for.

Results from following command before/after change applied
are shown below:

  $ ip link add dev veth1a type veth peer name veth1b \
                           type veth peer name veth1c

Before:
-------

<no output, no netdevs created>

After:
------

Error: duplicate "type": "veth" is the second value.

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Serhey Popovych 2017-12-28 13:01:04 +02:00 committed by Stephen Hemminger
parent b97c6fa71d
commit 8c0b19d178
2 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,9 @@ static int vxcan_parse_opt(struct link_util *lu, int argc, char **argv,
if (err < 0)
return err;
if (type)
duparg("type", argv[err]);
if (name) {
addattr_l(hdr, 1024,
IFLA_IFNAME, name, strlen(name) + 1);

View File

@ -63,6 +63,9 @@ static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
if (err < 0)
return err;
if (type)
duparg("type", argv[err]);
if (name) {
addattr_l(hdr, 1024,
IFLA_IFNAME, name, strlen(name) + 1);