diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-05-02 17:24:57 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-05-02 17:25:27 +0200 |
commit | 050d592eee6c96ae8e08c6dfefe42f10685f0718 (patch) | |
tree | c2d5396c458c0877d106687f95bcc50506c221ef | |
parent | 3b8a8e462ee3ed33a95c784b6c77c33377210ca3 (diff) | |
download | libmnl-050d592eee6c96ae8e08c6dfefe42f10685f0718.tar.gz libmnl-050d592eee6c96ae8e08c6dfefe42f10685f0718.zip |
examples: rtnl-route-dump: display also metric/priority
If present in the route message, otherwise simply skip it.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | examples/rtnl/rtnl-route-dump.c | 3 |
1 files changed, 3 insertions, 0 deletions
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] = {}; |