]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Remove a non-dissection related field from struct netdissect_options
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 14 Sep 2015 15:16:26 +0000 (17:16 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 14 Sep 2015 15:16:26 +0000 (17:16 +0200)
Remove 'ndo_immediate' from netdissect_options, only used is frontend.
Use instead 'immediate_mode' variable in frontend.

netdissect.h
tcpdump.c

index 57d3f7c2a62c1f1eaeb874baaf88ccaa11fef154..bc3cba6ee2485d6594b9f3904aea233b83d4ae25 100644 (file)
@@ -111,7 +111,6 @@ struct netdissect_options {
                                 * LF, CR and SPACE as graphical chars
                                 */
   int ndo_dlt;                  /* if != -1, ask libpcap for the DLT it names */
-  int ndo_immediate;            /* use immediate mode */
 
   int ndo_Hflag;               /* dissect 802.11s draft mesh standard */
   int ndo_packet_number;       /* print a packet number in the beginning of line */
index eb1241ad3859b937ef4eb3984daa5fbbadfd3490..11d1a0a9e36cd0f5c4d7854927f486452eb0523f 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -742,12 +742,12 @@ main(int argc, char **argv)
        int pflag=0;                    /* don't go promiscuous */
        netdissect_options Ndo;
        netdissect_options *ndo = &Ndo;
+       int immediate_mode = 0;
 
        memset(ndo, 0, sizeof(*ndo));
        ndo->ndo_dlt=-1;
        ndo_set_function_pointers(ndo);
        ndo->ndo_snaplen = DEFAULT_SNAPLEN;
-       ndo->ndo_immediate = 0;
 
        cnt = -1;
        device = NULL;
@@ -1162,7 +1162,7 @@ main(int argc, char **argv)
 
 #ifdef HAVE_PCAP_SET_IMMEDIATE_MODE
                case OPTION_IMMEDIATE_MODE:
-                       ndo->ndo_immediate = 1;
+                       immediate_mode = 1;
                        break;
 #endif
 
@@ -1209,7 +1209,7 @@ main(int argc, char **argv)
         * probably expecting to see packets pop up immediately.
         */
        if (WFileName == NULL && isatty(1))
-               ndo->ndo_immediate = 1;
+               immediate_mode = 1;
 #endif
 
 #ifdef WITH_CHROOT
@@ -1338,7 +1338,7 @@ main(int argc, char **argv)
 #endif
 
 #ifdef HAVE_PCAP_SET_IMMEDIATE_MODE
-               if (ndo->ndo_immediate) {
+               if (immediate_mode) {
                        status = pcap_set_immediate_mode(pd, 1);
                        if (status != 0)
                                error("%s: Can't set immediate mode: %s",