diff mbox series

[iproute2-next,1/2] ip route: Print "trap" nexthop indication

Message ID 20201119135731.410986-2-idosch@idosch.org (mailing list archive)
State Accepted
Delegated to: David Ahern
Headers show
Series ip: Nexthop flags extensions | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Ido Schimmel Nov. 19, 2020, 1:57 p.m. UTC
From: Ido Schimmel <idosch@nvidia.com>

The kernel can now signal that a nexthop is trapping packets instead of
forwarding them. Print the flag to help users understand the offload
state of each nexthop.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 ip/iproute.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/ip/iproute.c b/ip/iproute.c
index 05ec2c296579..ebb5f160fc44 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -362,6 +362,8 @@  void print_rt_flags(FILE *fp, unsigned int flags)
 		print_string(PRINT_ANY, NULL, "%s ", "pervasive");
 	if (flags & RTNH_F_OFFLOAD)
 		print_string(PRINT_ANY, NULL, "%s ", "offload");
+	if (flags & RTNH_F_TRAP)
+		print_string(PRINT_ANY, NULL, "%s ", "trap");
 	if (flags & RTM_F_NOTIFY)
 		print_string(PRINT_ANY, NULL, "%s ", "notify");
 	if (flags & RTNH_F_LINKDOWN)