]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-telnet.c
Avoiding conditional directives that break statements
[tcpdump] / print-telnet.c
index 7c5a737d33252d8e3f2c59d3a8cabdcfca132bc3..e01e91b865c3e256f82d245b85b4532dd4e7a07c 100644 (file)
  *      are preserved in all copies.
  */
 
-#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
 #include <stdio.h>
 
-#include "interface.h"
+#include "netdissect.h"
 
 #define TELCMDS
 #define TELOPTS
@@ -509,12 +508,11 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length)
 
        osp = sp;
 
-       if (ndo->ndo_qflag) {
-               ND_PRINT((ndo, "[telnet]"));
-               return;
-       }
-
        while (length > 0 && *sp == IAC) {
+               /*
+                * Parse the Telnet command without printing it,
+                * to determine its length.
+                */
                l = telnet_parse(ndo, sp, length, 0);
                if (l < 0)
                        break;