]> git.proxmox.com Git - mirror_iproute2.git/commit
utils: Introduce and use nodev() helper routine
authorSerhey Popovych <serhe.popovych@gmail.com>
Wed, 7 Mar 2018 08:40:36 +0000 (10:40 +0200)
committerDavid Ahern <dsahern@gmail.com>
Mon, 12 Mar 2018 00:58:36 +0000 (17:58 -0700)
commitfe99adbca4cbd48cfa8f50d3617fe7485424501e
tree1bffb24f7bb7238700db72c59d03df659a584956
parentf686f764682745daf6a93b0a6330ba42a961f858
utils: Introduce and use nodev() helper routine

There is a couple of places where we report error in case of no network
device is found. In all of them we output message in the same format to
stderr and either return -1 or 1 to the caller or exit with -1.

Introduce new helper function nodev() that takes name of the network
device caused error and returns -1 to it's caller. Either call exit()
or return to the caller to preserve behaviour before change.

Use -nodev() in traffic control (tc) code to return 1.

Simplify expression for checking for argument being 0/NULL in @if
statement.

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
28 files changed:
bridge/fdb.c
bridge/link.c
bridge/mdb.c
bridge/vlan.c
include/utils.h
ip/ip6tunnel.c
ip/ipaddress.c
ip/iplink.c
ip/iplink_bond.c
ip/iplink_bridge.c
ip/iplink_vxlan.c
ip/ipmroute.c
ip/ipneigh.c
ip/ipntable.c
ip/iproute.c
ip/iproute_lwtunnel.c
ip/iptunnel.c
ip/link_gre.c
ip/link_gre6.c
ip/link_ip6tnl.c
ip/link_iptnl.c
ip/link_vti.c
ip/link_vti6.c
lib/utils.c
tc/m_mirred.c
tc/tc_class.c
tc/tc_filter.c
tc/tc_qdisc.c