From 050d592eee6c96ae8e08c6dfefe42f10685f0718 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 2 May 2013 17:24:57 +0200 Subject: examples: rtnl-route-dump: display also metric/priority If present in the route message, otherwise simply skip it. Signed-off-by: Pablo Neira Ayuso --- examples/rtnl/rtnl-route-dump.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples') diff --git a/examples/rtnl/rtnl-route-dump.c b/examples/rtnl/rtnl-route-dump.c index a798515..59e0a9d 100644 --- a/examples/rtnl/rtnl-route-dump.c +++ b/examples/rtnl/rtnl-route-dump.c @@ -51,6 +51,9 @@ static void attributes_show_ipv4(struct nlattr *tb[]) struct in_addr *addr = mnl_attr_get_payload(tb[RTA_GATEWAY]); printf("gw=%s ", inet_ntoa(*addr)); } + if (tb[RTA_PRIORITY]) { + printf("prio=%u ", mnl_attr_get_u32(tb[RTA_PRIORITY])); + } if (tb[RTA_METRICS]) { int i; struct nlattr *tbx[RTAX_MAX+1] = {}; -- cgit v1.2.3