iproute2/lib
David Ahern 1ca2e08bd0 ip route: Make name of protocol 0 consistent
iproute2 can inconsistently show the name of protocol 0 if a route with
a custom protocol is added. For example:
  dsa@cartman:~$ ip -6 ro ls table all | egrep 'proto none|proto unspec'
  local ::1 dev lo  table local  proto none  metric 0  pref medium
  local fe80::225:90ff:fecb:1c18 dev lo  table local  proto none  metric 0  pref medium
  local fe80::92e2:baff:fe5c:da5d dev lo  table local  proto none  metric 0  pref medium

protocol 0 is pretty printed as "none". Add a route with a custom protocol:
  dsa@cartman:~$ sudo ip -6 ro add  2001:db8:200::1/128 dev eth0 proto 123

And now display has switched from "none" to "unspec":
  dsa@cartman:~$ ip -6 ro ls table all | egrep 'proto none|proto unspec'
  local ::1 dev lo  table local  proto unspec  metric 0  pref medium
  local fe80::225:90ff:fecb:1c18 dev lo  table local  proto unspec  metric 0  pref medium
  local fe80::92e2:baff:fe5c:da5d dev lo  table local  proto unspec  metric 0  pref medium

The rt_protos file has the id to name mapping as "unspec" while
rtnl_rtprot_tab[0] has "none". The presence of a custom protocol id
triggers reading the rt_protos file and overwriting the string in
rtnl_rtprot_tab. All of this is logic from 2004 and earlier.

Update rtnl_rtprot_tab to "unspec" to match the enum value.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
2017-02-17 15:12:29 -08:00
..
bpf.c bpf: export bpf_prog_load 2016-12-13 10:20:15 -08:00
color.c color: introduce color helpers and COLOR_CLEAR 2016-03-27 10:37:34 -07:00
coverity_model.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
dnet_ntop.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
dnet_pton.c dnet: fix strict aliasing warnings 2010-07-23 12:30:48 -07:00
exec.c move cmd_exec to lib utils 2016-12-13 10:20:16 -08:00
fs.c ip vrf: Improve cgroup2 error messages 2017-01-09 12:13:08 -08:00
inet_proto.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
ipx_ntop.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
ipx_pton.c utils: provide get_hex to read a hex digit from a char 2016-06-08 09:30:41 -07:00
json_writer.c json_writer: Removed automatic json-object type from the constructor 2016-07-20 12:02:02 -07:00
libgenl.c libgenl: introduce genl_init_handle 2016-08-17 13:59:21 -07:00
libnetlink.c libnetlink: break up dump function 2016-12-13 10:41:29 -08:00
ll_addr.c lib/ll_addr: improve ll_addr_n2a() a bit 2016-03-27 10:37:35 -07:00
ll_map.c fix netlink message length checks 2016-10-09 18:48:30 -07:00
ll_proto.c utils: add get_be{16, 32, 64}, use them where possible 2016-06-08 09:30:37 -07:00
ll_types.c ip: update link types to show 6lowpan and ieee802.15.4 monitor 2016-11-12 10:14:03 +03:00
Makefile whitespace cleanup 2017-01-12 17:31:20 -08:00
mpls_ntop.c add basic mpls support to iproute 2015-03-24 15:45:23 -07:00
mpls_pton.c add basic mpls support to iproute 2015-03-24 15:45:23 -07:00
names.c Replace malloc && memset by calloc 2016-07-20 12:05:24 -07:00
namespace.c lib/namespace: fix fd leakage in non-error case 2015-08-19 16:32:56 -07:00
rt_names.c ip route: Make name of protocol 0 consistent 2017-02-17 15:12:29 -08:00
utils.c utils: make hex2mem available to all users 2017-01-17 08:45:22 -08:00