Skip to content

Commit ab4a7ff

Browse files
committed
Disable promisc with -J
1 parent e7988b2 commit ab4a7ff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

userland/examples/pfcount_multichannel.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void printHelp(void) {
186186
printf("-i <device> Device name (No device@channel)\n");
187187

188188
printf("-e <direction> 0=RX+TX, 1=RX only, 2=TX only\n");
189-
printf("-P <0|1> Enable (1 - default) or disable (0) promisc\n");
189+
printf("-J Do not enable promiscuous mode\n");
190190
printf("-l <len> Capture length\n");
191191
printf("-m Print more metadata with -v (extended packet header)\n");
192192
printf("-w <watermark> Watermark\n");
@@ -350,7 +350,7 @@ int main(int argc, char* argv[]) {
350350
thiszone = gmt_to_local(0);
351351
numCPU = sysconf( _SC_NPROCESSORS_ONLN );
352352

353-
while((c = getopt(argc,argv,"hi:I:l:mvae:w:b:rp:P:g:")) != -1) {
353+
while((c = getopt(argc,argv,"hi:I:Jl:mvae:w:b:rp:g:")) != -1) {
354354
switch(c) {
355355
case 'h':
356356
printHelp();
@@ -378,6 +378,9 @@ int main(int argc, char* argv[]) {
378378
src_ip_rule = ntohl(inet_addr(optarg));
379379
src_ip_rule_set = 1;
380380
break;
381+
case 'J':
382+
promisc = 0;
383+
break;
381384
case 'm':
382385
use_extended_pkt_header = 1;
383386
break;
@@ -397,9 +400,6 @@ int main(int argc, char* argv[]) {
397400
case 'p':
398401
poll_duration = atoi(optarg);
399402
break;
400-
case 'P':
401-
promisc = atoi(optarg);
402-
break;
403403
case 'g':
404404
bind_mask = strdup(optarg);
405405
break;

0 commit comments

Comments
 (0)