mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-12-13 03:33:42 +08:00
1ca2e08bd0
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> |
||
---|---|---|
.. | ||
bpf.c | ||
color.c | ||
coverity_model.c | ||
dnet_ntop.c | ||
dnet_pton.c | ||
exec.c | ||
fs.c | ||
inet_proto.c | ||
ipx_ntop.c | ||
ipx_pton.c | ||
json_writer.c | ||
libgenl.c | ||
libnetlink.c | ||
ll_addr.c | ||
ll_map.c | ||
ll_proto.c | ||
ll_types.c | ||
Makefile | ||
mpls_ntop.c | ||
mpls_pton.c | ||
names.c | ||
namespace.c | ||
rt_names.c | ||
utils.c |