Skip to content

Commit 3c015dd

Browse files
committed
Rename the variable 'packets_skipped' to 'packets_to_skip'
1 parent dc1b49b commit 3c015dd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tcpdump.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static int timeout = 1000; /* default timeout = 1000 ms = 1 s */
207207
static int immediate_mode;
208208
#endif
209209
static int count_mode;
210-
static u_int packets_skipped;
210+
static u_int packets_to_skip;
211211

212212
static int infodelay;
213213
static int infoprint;
@@ -2055,7 +2055,7 @@ main(int argc, char **argv)
20552055
break;
20562056

20572057
case OPTION_SKIP:
2058-
packets_skipped = parse_u_int("packet skip count",
2058+
packets_to_skip = parse_u_int("packet skip count",
20592059
optarg, NULL, 0, INT_MAX, 0);
20602060
break;
20612061

@@ -2098,10 +2098,10 @@ main(int argc, char **argv)
20982098
warning("-x[x] and -X[X] are mutually exclusive. -x[x] ignored.");
20992099

21002100
if (cnt != -1)
2101-
if ((int)packets_skipped > (INT_MAX - cnt))
2102-
// cnt + (int)packets_skipped used in pcap_loop() call
2101+
if ((int)packets_to_skip > (INT_MAX - cnt))
2102+
// cnt + (int)packets_to_skip used in pcap_loop() call
21032103
error("Overflow (-c count) %d + (--skip count) %d", cnt,
2104-
(int)packets_skipped);
2104+
(int)packets_to_skip);
21052105

21062106
if (Dflag)
21072107
show_devices_and_exit();
@@ -2699,7 +2699,7 @@ DIAG_ON_ASSIGN_ENUM
26992699

27002700
do {
27012701
status = pcap_loop(pd,
2702-
(cnt == -1 ? -1 : cnt + (int)packets_skipped),
2702+
(cnt == -1 ? -1 : cnt + (int)packets_to_skip),
27032703
callback, pcap_userdata);
27042704
if (WFileName == NULL) {
27052705
/*
@@ -3190,7 +3190,7 @@ dump_packet_and_trunc(u_char *user, const struct pcap_pkthdr *h, const u_char *s
31903190

31913191
dump_info = (struct dump_info *)user;
31923192

3193-
if (packets_captured <= packets_skipped)
3193+
if (packets_captured <= packets_to_skip)
31943194
return;
31953195

31963196
/*
@@ -3322,7 +3322,7 @@ dump_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
33223322

33233323
dump_info = (struct dump_info *)user;
33243324

3325-
if (packets_captured <= packets_skipped)
3325+
if (packets_captured <= packets_to_skip)
33263326
return;
33273327

33283328
pcap_dump((u_char *)dump_info->pdd, h, sp);
@@ -3344,7 +3344,7 @@ print_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
33443344

33453345
++infodelay;
33463346

3347-
if (!count_mode && packets_captured > packets_skipped)
3347+
if (!count_mode && packets_captured > packets_to_skip)
33483348
pretty_print_packet((netdissect_options *)user, h, sp, packets_captured);
33493349

33503350
--infodelay;

0 commit comments

Comments
 (0)