summaryrefslogtreecommitdiff
path: root/mac80211.c
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-04-17 22:04:21 +0300
committerTobias Klauser <tklauser@distanz.ch>2015-04-20 09:31:43 +0200
commitf43bbe9e895a05a71ebfa5fb676f068621bd5014 (patch)
treefe2be9b9c87e5bec73deb60bdfb9c9205a492a27 /mac80211.c
parent47a7037955bfa7405a0a676f214c26d136b8ca9a (diff)
mac80211: Check existence of generated monX device
Fix then case when netsniff-ng fails if there is already an existing monX device while generating one. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'mac80211.c')
-rw-r--r--mac80211.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mac80211.c b/mac80211.c
index c089574..09f15b7 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -226,6 +226,10 @@ void enter_rfmon_mac80211(const char *device, char **mondev)
char mondevice[32];
slprintf(mondevice, sizeof(mondevice), "mon%u", n);
+
+ if (device_ifindex_get(mondevice) > 0)
+ continue;
+
ret = nl80211_add_mon_if(&nlstate, device, mondevice);
if (ret == 0) {
*mondev = xstrdup(mondevice);