From: Serhey Popovych Date: Thu, 28 Dec 2017 11:01:04 +0000 (+0200) Subject: vxcan,veth: Forbid "type" for peer device X-Git-Tag: v4.15.0~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c0b19d178fe97cd991b7501a9fa051ff701d6c5;p=thirdparty%2Fiproute2.git 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: ------- After: ------ Error: duplicate "type": "veth" is the second value. Signed-off-by: Serhey Popovych Signed-off-by: Stephen Hemminger --- diff --git a/ip/iplink_vxcan.c b/ip/iplink_vxcan.c index c13224c3d..ed0ad8b98 100644 --- a/ip/iplink_vxcan.c +++ b/ip/iplink_vxcan.c @@ -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); diff --git a/ip/link_veth.c b/ip/link_veth.c index fcfd1ef32..fddb7ac3c 100644 --- a/ip/link_veth.c +++ b/ip/link_veth.c @@ -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);