From 6e3a87093dfcd8b4b62685e67b565d842c631da1 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Mon, 12 Jun 2017 23:55:37 +0300 Subject: trafgen: Fix output pcap file name length trimming Trim output name to IFNAMSIZ only if the output is a networking device, otherwise the following error occured if output name is greater then IFNAMSIZ: $ trafgen -n 1 '{ udp() }' -o /tmp/xxxxxxxxxxxxxx.pcap No networking device or pcap file: /tmp/xxxxxxxxxx Failed to open output device Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- trafgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'trafgen.c') diff --git a/trafgen.c b/trafgen.c index 6ae0076..b40d362 100644 --- a/trafgen.c +++ b/trafgen.c @@ -1084,7 +1084,7 @@ int main(int argc, char **argv) break; case 'd': case 'o': - ctx.device = xstrndup(optarg, IFNAMSIZ); + ctx.device = xstrdup(optarg); break; case 'H': prio_high = true; -- cgit v1.2.3-54-g00ecf