]> The Tcpdump Group git mirrors - tcpdump/commitdiff
We already print "Unhandled Management subtype(N)" for management frames
authorguy <guy>
Sat, 30 Jul 2005 18:48:35 +0000 (18:48 +0000)
committerguy <guy>
Sat, 30 Jul 2005 18:48:35 +0000 (18:48 +0000)
we don't handle; there's no need to print "Unknown subtype N" as well.

Revert to using null strings for the unknown management frame types -
that way we don't have to check for a null pointer.

print-802_11.c

index 968379e2b47af7640513e3efa16ba583b7df7544..9a8f68ab30148bab57883ca32ee561000bbdba52 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.34 2005-07-30 00:05:32 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.35 2005-07-30 18:48:35 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -71,16 +71,16 @@ static const char *subtype_text[16]={
        "ReAssoc Response",
        "Probe Request",
        "Probe Response",
        "ReAssoc Response",
        "Probe Request",
        "Probe Response",
-       NULL,
-       NULL,
+       "",
+       "",
        "Beacon",
        "ATIM",
        "Disassociation",
        "Authentication",
        "DeAuthentication",
        "Beacon",
        "ATIM",
        "Disassociation",
        "Authentication",
        "DeAuthentication",
-       NULL,
-       NULL,
-       NULL
+       "",
+       "",
+       ""
 };
 
 static const char *status_text[] = {
 };
 
 static const char *status_text[] = {
@@ -515,10 +515,7 @@ static int
 mgmt_body_print(u_int16_t fc, const struct mgmt_header_t *pmh,
     const u_char *p)
 {
 mgmt_body_print(u_int16_t fc, const struct mgmt_header_t *pmh,
     const u_char *p)
 {
-       if (subtype_text[FC_SUBTYPE(fc)] != NULL)
-               printf("%s", subtype_text[FC_SUBTYPE(fc)]);
-       else
-               printf("Unknown subtype %u", FC_SUBTYPE(fc));
+       printf("%s", subtype_text[FC_SUBTYPE(fc)]);
 
        switch (FC_SUBTYPE(fc)) {
        case ST_ASSOC_REQUEST:
 
        switch (FC_SUBTYPE(fc)) {
        case ST_ASSOC_REQUEST: