diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2015-05-03 11:14:07 +0300 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-05-04 09:45:09 +0200 |
commit | 47fb4f6219e6936fd99d28a1e43135544d10b4ff (patch) | |
tree | b7fcee4cfd3c1e6f4bb1699fdb3a951959827523 /trafgen.c | |
parent | aa6b0e3ae806029e803709bfaf9938ae5b1b785f (diff) |
trafgen: Delete rfmon mac80211 device on panic
Fixed case when rfmon mac80211 created device remains after trafgen
failed (for ex. - incorrect cfg file), so just delete it when panic
occured.
Also made panic handlers invoking per process and only once.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen.c')
-rw-r--r-- | trafgen.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -852,6 +852,11 @@ static unsigned int generate_srand_seed(void) return _seed; } +static void on_panic_del_rfmon(void *arg) +{ + leave_rfmon_mac80211(arg); +} + int main(int argc, char **argv) { bool slow = false, invoke_cpp = false, reseed = true, cpustats = true; @@ -1067,6 +1072,7 @@ int main(int argc, char **argv) xfree(ctx.device); enter_rfmon_mac80211(ctx.device_trans, &ctx.device); + panic_func_add(on_panic_del_rfmon, ctx.device); sleep(0); } |