Skip to content

Commit

Permalink
netsniff-ng: fix snooping on any device when no option is given
Browse files Browse the repository at this point in the history
Commit f43bbe9 ("mac80211: Check existence of generated monX
device") broke starting netsniff-ng w/o any arguments, that is,
sniffing on "any" device. The test in device_ifindex() should be
index < 0.

Fixes: f43bbe9 ("mac80211: Check existence of generated monX device")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
borkmann committed Apr 21, 2015
1 parent 264ef01 commit 42ca7e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dev.c
Expand Up @@ -39,7 +39,8 @@ int device_ifindex_get(const char *ifname)
int device_ifindex(const char *ifname)
{
int index = device_ifindex_get(ifname);
if (unlikely(index <= 0))

if (unlikely(index < 0))
panic("Cannot get ifindex from device!\n");

return index;
Expand Down

0 comments on commit 42ca7e4

Please sign in to comment.