hi,
I am using netgear routers.
model: WNDR3700v2
I want to set the wireless interface (ath9k) in monitor mode to sniff the
traffic.
I am doing the following :
1. Opening a raw socket
socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL))
2. making the following ioctl call to connect to device. Device is
mon.wlan0 ( wlan in monitor mode, hostap uses this)
ioctl(in_fd, SIOCGIFINDEX, &ifr) ;
3. binding the socket
struct sockaddr_ll sll;
memset(&sll, 0, sizeof(sll));
sll.sll_family = AF_PACKET;
sll.sll_ifindex = ifr.ifr_ifindex;
sll.sll_protocol = htons(ETH_P_ALL);
if (0 > bind(in_fd, (struct sockaddr *) &sll, sizeof(sll)
4. setting the following options
setsockopt(in_fd, SOL_SOCKET, SO_RCVBUF, &skbsz, sizeof(skbsz))
getsockopt(in_fd, SOL_SOCKET, SO_RCVBUF, &skbsz,
(socklen_t*)&skbsz_l)
setsockopt(in_fd, SOL_SOCKET, SO_RCVTIMEO, &rto, sizeof(rto)
Checking tcpdump and later *pcap library *reveals they also call ioctil
with the following parameter SIOCGIWPRIV .
On execution of the program, i get an error that device does not support
private calls.
The same happen when I do an ioctl call with SIOCIWFIRSTPRIV.
When I ignore making these two calls, I am getting results different from
tcpdump.
Can someone hint on :
1.Why they are failing ? and how to fix them ?
2. Are they necessary to set the mode in monitor mode ?
3. Any other calls I should be making ?
Abhinav
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel