patch and iw_can_change_channel are unneeded, so they are removed
This commit is contained in:
parent
e5701cfb78
commit
1125bf244a
4
README
4
README
@ -7,10 +7,6 @@ is essencially a WiFi DoS attack tool created for educational
|
||||
purposes only. It works only in Linux and requires wireless card
|
||||
drivers capable of injecting packets in wireless networks.
|
||||
|
||||
If your Linux kernel is version 2.6.35 or above, you have to
|
||||
apply the patch patches/cfg80211_monitor_mode_channel_fix.patch
|
||||
to the kernel.
|
||||
|
||||
How to use it: Just run it as root and put as first argument the
|
||||
card interface. It will automatically put your interface in monitor
|
||||
mode and it will listen at channel range 1-14. If there is no AP in the
|
||||
|
@ -1,14 +0,0 @@
|
||||
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
|
||||
index 2fcfe09..3f63fae 100644
|
||||
--- a/net/wireless/chan.c
|
||||
+++ b/net/wireless/chan.c
|
||||
@@ -85,9 +85,6 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
|
||||
struct ieee80211_channel *chan;
|
||||
int result;
|
||||
|
||||
- if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
|
||||
- wdev = NULL;
|
||||
-
|
||||
if (wdev) {
|
||||
ASSERT_WDEV_LOCK(wdev);
|
||||
|
18
src/iw.c
18
src/iw.c
@ -199,24 +199,6 @@ ssize_t iw_read(struct iw_dev *dev, void *buf, size_t count, uint8_t **pkt, size
|
||||
return r;
|
||||
}
|
||||
|
||||
int iw_can_change_channel(struct iw_dev *dev) {
|
||||
struct iwreq iwr;
|
||||
|
||||
/* set channel */
|
||||
memset(&iwr, 0, sizeof(iwr));
|
||||
strncpy(iwr.ifr_name, dev->ifname, sizeof(iwr.ifr_name)-1);
|
||||
iwr.u.freq.flags = IW_FREQ_FIXED;
|
||||
iwr.u.freq.m = 1;
|
||||
|
||||
if (ioctl(dev->fd_in, SIOCSIWFREQ, &iwr) < 0)
|
||||
return 0;
|
||||
if (ioctl(dev->fd_in, SIOCGIWFREQ, &iwr) < 0)
|
||||
return 0;
|
||||
|
||||
/* channel 1 frequency is 2412 */
|
||||
return iwr.u.freq.m == 2412;
|
||||
}
|
||||
|
||||
int iw_set_channel(struct iw_dev *dev, int chan) {
|
||||
struct iwreq iwr;
|
||||
ssize_t ret;
|
||||
|
1
src/iw.h
1
src/iw.h
@ -58,7 +58,6 @@ int iw_open(struct iw_dev *dev);
|
||||
void iw_close(struct iw_dev *dev);
|
||||
ssize_t iw_write(struct iw_dev *dev, void *buf, size_t count);
|
||||
ssize_t iw_read(struct iw_dev *dev, void *buf, size_t count, uint8_t **pkt, size_t *pkt_sz);
|
||||
int iw_can_change_channel(struct iw_dev *dev);
|
||||
int iw_set_channel(struct iw_dev *dev, int chan);
|
||||
|
||||
#endif
|
||||
|
@ -253,13 +253,6 @@ int main(int argc, char *argv[]) {
|
||||
goto _errout_no_thread;
|
||||
}
|
||||
|
||||
if (!iw_can_change_channel(&dev)) {
|
||||
fprintf(stderr, "%s can not change channels in monitor mode.\n"
|
||||
"Maybe you need to patch your kernel with:\n"
|
||||
" patches/cfg80211_monitor_mode_channel_fix.patch\n", dev.ifname);
|
||||
goto _errout_no_thread;
|
||||
}
|
||||
|
||||
pfd[1].fd = dev.fd_in;
|
||||
pfd[1].revents = 0;
|
||||
pfd[1].events = POLLIN;
|
||||
|
Loading…
Reference in New Issue
Block a user