diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2018-03-06 18:28:27 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2018-03-06 18:28:27 +0100 |
commit | 0cba196c4e8d02c5d96d9eb945583869afde5d2d (patch) | |
tree | afe99fa0e00b36696cbea274e65b07dce7b26f65 | |
parent | 44ceece354c50795ba04e450b9269e6e3f92dd34 (diff) |
trafgen: don't close dev_out and dev_in in parent process
They are opened in main_loop which is only executed in the child(ren),
so close them there again. This avoids closing the devices twice, which
may lead to segfaults.
Fixes #188
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | trafgen.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -976,6 +976,10 @@ static void main_loop(struct ctx *ctx, char *confname, bool slow, else xmit_fastpath_or_die(ctx, cpu, orig_num); + dev_io_close(ctx->dev_out); + if (ctx->dev_in) + dev_io_close(ctx->dev_in); + cleanup_packets(); } @@ -1354,10 +1358,6 @@ thread_out: if (dev_io_is_netdev(ctx.dev_out) && set_irq_aff) device_restore_irq_affinity_list(); - dev_io_close(ctx.dev_out); - if (ctx.dev_in) - dev_io_close(ctx.dev_in); - argv_free(cpp_argv); free(ctx.device); free(ctx.rhost); |