From e6765c1e9bf2563b91a21c25cd1491ae7bfffc62 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Mon, 14 Aug 2017 14:49:19 +0200 Subject: [PATCH] monitor: Actually print management frame subtype The subtype was only printed if mpdu_validate had returned an error for the frame, i.e. would not be printed for well formed frames. This was probably an intent to avoid printing the frame subtype after all the conents of the body frame had been printed already, but iwmon only supports printing of Authentication and Deauthentication frames so far. --- monitor/nlmon.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 938473ac..a1afc41a 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -2567,6 +2567,8 @@ static void print_frame_type(unsigned int level, const char *label, print_attr(level + 1, "Type: %s (%u)", str, type); + str = NULL; + switch (subtype) { case 0x00: str = "Association request"; @@ -2599,12 +2601,16 @@ static void print_frame_type(unsigned int level, const char *label, str = "Disassociation"; break; case 0x0b: - str = "Authentication"; - print_authentication_mgmt_frame(level + 1, mpdu); + if (mpdu) + print_authentication_mgmt_frame(level + 1, mpdu); + else + str = "Authentication"; break; case 0x0c: - str = "Deauthentication"; - print_deauthentication_mgmt_frame(level + 1, mpdu); + if (mpdu) + print_deauthentication_mgmt_frame(level + 1, mpdu); + else + str = "Deauthentication"; break; case 0x0d: str = "Action"; @@ -2617,7 +2623,7 @@ static void print_frame_type(unsigned int level, const char *label, break; } - if (!mpdu) + if (str) print_attr(level + 1, "Subtype: %s (%u)", str, subtype); }