]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ipaddress: Improve print_linkinfo()
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 15 Feb 2018 21:23:19 +0000 (23:23 +0200)
committerDavid Ahern <dsahern@gmail.com>
Fri, 16 Feb 2018 16:14:15 +0000 (08:14 -0800)
commit9516823051cee49d1eddd87aa3ecb7770f0f1c7b
tree0262d2bf1bd6483a8a703626cbc6afb2a1c7bfe2
parentfe269b6e7c5de9870ffa5c3889a51dbb26e4e6ff
ipaddress: Improve print_linkinfo()

There are few places to improve:

  1) return -1 when entry is filtered instead of zero, which means
     accept entry: ipaddress_list_flush_or_save() the only user of this

  2) use ll_idx_n2a() as last resort to translate name to index for
     "should never happen" cases when cache shouldn't be considered

  3) replace open coded access to IFLA_IFNAME attribute data by
     RTA_DATA() with rta_getattr_str()

  4) simplify ifname printing since name is never NULL, thanks to (2).

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
ip/ipaddress.c