]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ip route: Print "rt_offload" and "rt_trap" indication
authorIdo Schimmel <idosch@mellanox.com>
Thu, 16 Jan 2020 18:43:48 +0000 (20:43 +0200)
committerDavid Ahern <dsahern@gmail.com>
Sat, 18 Jan 2020 21:40:20 +0000 (21:40 +0000)
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>
ip/iproute.c

index 32bb52df250c25acd6031325ffe89009004f978a..93b805c9004d65c1917d94724b79448b4c3cd40b 100644 (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);
 }