]> git.proxmox.com Git - mirror_iproute2.git/commit
iplink: Improve index parameter handling
authorSerhey Popovych <serhe.popovych@gmail.com>
Mon, 18 Dec 2017 18:54:06 +0000 (20:54 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 19 Dec 2017 16:11:38 +0000 (08:11 -0800)
commitb7ea12ae4399461d18442cfcecec3e2e908fb61b
treed6eb9a66b848f4e08c22f6acfe7102a0b0121b7a
parentbd9cea5d8c9dc6266f9529e1be6bc7dab4519d9c
iplink: Improve index parameter handling

Correctly check for valid network device index supplied on
command line: indexes are always greather than zero. Check
for duplicate "index" argument.

Initialize @index to 0 to simplify handling it in iplink_modify().
Other callers (link_veth.c, iplink_vxcan.c) already did so.

No need to initialize ifi_index with 0 since it is already
initialized at the @struct req initialization time and not
modified in iplink_parse().

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iplink.c