]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
Change -z command help text to -z postrotate-command
[tcpdump] / tcpdump.c
index 534721a5848bd873275d9adc13fbd5aa35fd4357..3d491c4e9315341c3b6a914878ff46a130fb3e2f 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1115,6 +1115,8 @@ main(int argc, char **argv)
                                ndo->ndo_packettype = PT_PGM_ZMTP1;
                        else if (ascii_strcasecmp(optarg, "lmp") == 0)
                                ndo->ndo_packettype = PT_LMP;
+            else if (strcasecmp(optarg, "resp") == 0)
+                ndo->ndo_packettype = PT_RESP;
                        else
                                error("unknown packet type `%s'", optarg);
                        break;
@@ -1840,19 +1842,24 @@ main(int argc, char **argv)
                                         * We're printing the decoded packets;
                                         * switch to the new DLT.
                                         *
-                                        * To do that, we need to recompile
-                                        * the filter, change the printer,
-                                        * and change the DLT name.
+                                        * To do that, we need to change
+                                        * the printer, change the DLT name,
+                                        * and recompile the filter with
+                                        * the new DLT.
                                         */
                                        dlt = new_dlt;
-                                       if (pcap_compile(pd, &fcode, cmdbuf, Oflag, netmask) < 0)
-                                               error("%s", pcap_geterr(pd));
-                                       if (pcap_setfilter(pd, &fcode) < 0)
-                                               error("%s", pcap_geterr(pd));
                                        ndo->ndo_if_printer = get_if_printer(ndo, dlt);
                                        dlt_name = pcap_datalink_val_to_name(dlt);
+                                       if (pcap_compile(pd, &fcode, cmdbuf, Oflag, netmask) < 0)
+                                               error("%s", pcap_geterr(pd));
                                }
 
+                               /*
+                                * Set the filter on the new file.
+                                */
+                               if (pcap_setfilter(pd, &fcode) < 0)
+                                       error("%s", pcap_geterr(pd));
+
                                /*
                                 * Report the new file.
                                 */
@@ -2381,7 +2388,7 @@ print_usage(void)
 #endif
        (void)fprintf(stderr, "[ -T type ] [ --version ] [ -V file ]\n");
        (void)fprintf(stderr,
-"\t\t[ -w file ] [ -W filecount ] [ -y datalinktype ] [ -z command ]\n");
+"\t\t[ -w file ] [ -W filecount ] [ -y datalinktype ] [ -z postrotate-command ]\n");
        (void)fprintf(stderr,
 "\t\t[ -Z user ] [ expression ]\n");
 }