summaryrefslogtreecommitdiff
path: root/trafgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'trafgen.c')
-rw-r--r--trafgen.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/trafgen.c b/trafgen.c
index 97ac046..9b54399 100644
--- a/trafgen.c
+++ b/trafgen.c
@@ -185,31 +185,31 @@ static void __noreturn help(void)
puts("http://www.netsniff-ng.org\n\n"
"Usage: trafgen [options] [packet]\n"
"Options:\n"
- " -i|-c|--in|--conf <cfg/-> Packet configuration file/stdin\n"
- " -o|-d|--out|--dev <netdev> Networking device i.e., eth0\n"
- " -p|--cpp Run packet config through C preprocessor\n"
- " -D|--define Add macro/define for C preprocessor\n"
- " -J|--jumbo-support Support 64KB super jumbo frames (def: 2048B)\n"
- " -R|--rfraw Inject raw 802.11 frames\n"
- " -s|--smoke-test <ipv4> Probe if machine survived fuzz-tested packet\n"
- " -n|--num <uint> Number of packets until exit (def: 0)\n"
- " -r|--rand Randomize packet selection (def: round robin)\n"
- " -P|--cpus <uint> Specify number of forks(<= CPUs) (def: #CPUs)\n"
- " -t|--gap <time> Set approx. interpacket gap (s/ms/us/ns, def: us)\n"
- " -b|--rate <rate> Send traffic at specified rate (pps/B/kB/MB/GB/kbit/Mbit/Gbit/KiB/MiB/GiB)\n"
- " -S|--ring-size <size> Manually set mmap size (KiB/MiB/GiB)\n"
- " -E|--seed <uint> Manually set srand(3) seed\n"
- " -u|--user <userid> Drop privileges and change to userid\n"
- " -g|--group <groupid> Drop privileges and change to groupid\n"
- " -H|--prio-high Make this high priority process\n"
- " -A|--no-sock-mem Don't tune core socket memory\n"
- " -Q|--notouch-irq Do not touch IRQ CPU affinity of NIC\n"
- " -q|--qdisc-path Enable qdisc kernel path (default off since 3.14)\n"
- " -V|--verbose Be more verbose\n"
- " -C|--no-cpu-stats Do not print CPU time statistics on exit\n"
- " -v|--version Show version and exit\n"
- " -e|--example Show built-in packet config example\n"
- " -h|--help Guess what?!\n\n"
+ " -i|-c|--in|--conf <cfg/-> Packet configuration file/stdin\n"
+ " -o|-d|--out|--dev <netdev|.cfg|.pcap> Networking device or configuration file i.e., eth0\n"
+ " -p|--cpp Run packet config through C preprocessor\n"
+ " -D|--define Add macro/define for C preprocessor\n"
+ " -J|--jumbo-support Support 64KB super jumbo frames (def: 2048B)\n"
+ " -R|--rfraw Inject raw 802.11 frames\n"
+ " -s|--smoke-test <ipv4> Probe if machine survived fuzz-tested packet\n"
+ " -n|--num <uint> Number of packets until exit (def: 0)\n"
+ " -r|--rand Randomize packet selection (def: round robin)\n"
+ " -P|--cpus <uint> Specify number of forks(<= CPUs) (def: #CPUs)\n"
+ " -t|--gap <time> Set approx. interpacket gap (s/ms/us/ns, def: us)\n"
+ " -b|--rate <rate> Send traffic at specified rate (pps/B/kB/MB/GB/kbit/Mbit/Gbit/KiB/MiB/GiB)\n"
+ " -S|--ring-size <size> Manually set mmap size (KiB/MiB/GiB)\n"
+ " -E|--seed <uint> Manually set srand(3) seed\n"
+ " -u|--user <userid> Drop privileges and change to userid\n"
+ " -g|--group <groupid> Drop privileges and change to groupid\n"
+ " -H|--prio-high Make this high priority process\n"
+ " -A|--no-sock-mem Don't tune core socket memory\n"
+ " -Q|--notouch-irq Do not touch IRQ CPU affinity of NIC\n"
+ " -q|--qdisc-path Enable qdisc kernel path (default off since 3.14)\n"
+ " -V|--verbose Be more verbose\n"
+ " -C|--no-cpu-stats Do not print CPU time statistics on exit\n"
+ " -v|--version Show version and exit\n"
+ " -e|--example Show built-in packet config example\n"
+ " -h|--help Guess what?!\n\n"
"Examples:\n"
" trafgen --dev eth0 --conf trafgen.cfg\n"
" trafgen -e | trafgen -i - -o eth0 --cpp -n 1\n"
@@ -1284,8 +1284,8 @@ int main(int argc, char **argv)
protos_init(ctx.dev_out);
- if (shaper_is_set(&ctx.sh) || (ctx.dev_in && dev_io_is_pcap(ctx.dev_in))
- || dev_io_is_pcap(ctx.dev_out)) {
+ if (shaper_is_set(&ctx.sh) || (ctx.dev_in && !dev_io_is_netdev(ctx.dev_in))
+ || !dev_io_is_netdev(ctx.dev_out)) {
prctl(PR_SET_TIMERSLACK, 1UL);
/* Fall back to single core to not mess up correct timing.