ip route: Print "rt_offload" and "rt_trap" indication

The kernel now signals the offload state of a route using the
'RTM_F_OFFLOAD' and 'RTM_F_TRAP' flags. Print these to help users
understand the offload state of each route. The "rt_" prefix is used in
order to distinguish it from the offload state of nexthops.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
Ido Schimmel 2020-01-16 20:43:48 +02:00 committed by David Ahern
parent 8b802d20e4
commit ed81a2a040
1 changed files with 4 additions and 0 deletions

View File

@ -368,6 +368,10 @@ void print_rt_flags(FILE *fp, unsigned int flags)
print_string(PRINT_ANY, NULL, "%s ", "linkdown");
if (flags & RTNH_F_UNRESOLVED)
print_string(PRINT_ANY, NULL, "%s ", "unresolved");
if (flags & RTM_F_OFFLOAD)
print_string(PRINT_ANY, NULL, "%s ", "rt_offload");
if (flags & RTM_F_TRAP)
print_string(PRINT_ANY, NULL, "%s ", "rt_trap");
close_json_array(PRINT_JSON, NULL);
}