From 2749e4e4a2bc782504739eb22252d281ae9bcd16 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 12 Aug 2014 17:24:03 -0700 Subject: [PATCH] monitor: Print details for RTNL Set Link commands --- monitor/nlmon.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index fcc81381..a46af0a6 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -1556,6 +1556,7 @@ void nlmon_print_rtnl(struct nlmon *nlmon, const struct timeval *tv, for (nlmsg = data; NLMSG_OK(nlmsg, aligned_size); nlmsg = NLMSG_NEXT(nlmsg, aligned_size)) { + const struct ifinfomsg *ifi; char extra_str[32]; const char *str; bool out; @@ -1617,6 +1618,18 @@ void nlmon_print_rtnl(struct nlmon *nlmon, const struct timeval *tv, print_packet(tv, out ? '<' : '>', COLOR_YELLOW, "RTNL", str, extra_str); + + switch (nlmsg->nlmsg_type) { + case RTM_SETLINK: + ifi = NLMSG_DATA(nlmsg); + + print_field("Interface Index: %d", ifi->ifi_index); + + print_hexdump(0, NLMSG_DATA(nlmsg) + + NLMSG_ALIGN(sizeof(*ifi)), + NLMSG_PAYLOAD(nlmsg, sizeof(*ifi))); + break; + } } }