-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openwrt: Issue finding interfaces #421
Comments
`root@OpenWrt:~# strace hcxdumptool -i wlan0 -w capture.pcapngexecve("/usr/sbin/hcxdumptool", ["hcxdumptool", "-i", "wlan0", "-w", "capture.pcapng"], 0x7fd7bffb60 /* 13 vars */) = 0 ) = 92 ) = 92 ) = 9 root@OpenWrt:~#` |
`root@OpenWrt:~ iwconfig eth0 no wireless extensions. eth1 no wireless extensions. lan4 no wireless extensions. lan3 no wireless extensions. lan2 no wireless extensions. lan1 no wireless extensions. lan5 no wireless extensions. br-lan no wireless extensions. wlan0 no wireless extensions. root@OpenWrt:~ airmon-ng PHY Interface Driver Chipset phy0 wlan0 mt798x-wmac Not pci, usb, or sdio root@OpenWrt:~ iw wlan0 info |
`root@OpenWrt:~# strace hcxdumptool -i wlan0mon -w capture.pcapng ) = 92 ) = 9 |
strace is not helpful in this case, because hcxdumptool use NETLINK to retrieve the interface list instead of requesting it directly from "/sys/class/ieee80211/phy1/device/driver":
First of all we need to find the exact error: RTNETLINK or NL80211.
Than run: call function to get Iinterface (L)ist If we need to debug NETLINK we have to add a NETLINK MONITOR INTERFACE:
Now the communication between hcxdumptool and the kernel can be monitored via tshark or Wireshark or tcpdump. Next step is to debug NETLINK: |
My candidates: either RTNETLINK is broken or GENERIC NETLINK (NL80211) is broken BTW: This version has been confirmed as working: |
Latest git;
|
I'll check it. |
That is the header file of the Linux Berkeley Packet Filter. |
"/root/openwrt/build_dir/target-aarch64_cortex-a53_musl/libbpf-1.3.0/include/linux/filter.h |
it's in the build system, but not available for hcxdumptool specific to use?`I have no clue |
looks like a gcc include path configuration problem.
|
|
Since v6.3.0 hcxdumptool has the option to add a Berkeley Packet Filter. |
Out of scope: rtl8xxxu Please take a look at this: and this: Could be a fix (driver crash) and an improvement add TP-Link TL-WN8200ND v3) for your driver, too: |
" phy0 wlan0 mt798x-wmac Not pci, usb, or sdio root@OpenWrt:~# hcxdumptool -i wlan0mon -w capture.pcapng Requesting physical interface capabilities. This may take some time. failed to get interface list 1 ERROR(s) during runtime After reinstall of OpenWRT (full flash) and clean install, I dont know what up |
" PHY Interface Driver Chipset phy0 wlan0 mt798x-wmac Not pci, usb, or sdio root@OpenWrt:~ Requesting physical interface capabilities. This may take some time. failed to get interface list 1 ERROR(s) during runtime root@OpenWrt:~ |
I'll code a test version. Please give me some minutes. |
Here we go: replace git version by this one
Please do not use airmon-ng or iw to set a VIF (wlan0mon). |
Now rtl8xxxu is more developed, so I left mine |
Yup, "Failed to get interface list" |
That's interesting. |
But I have an idea. |
Same procedure: Output should look like this:
|
airmon-ng is not affected, because it read the interface information directly from "/sys/class/ieee80211/phy1/device/driver" and not via NETLINK. |
Ok, let me check 💯 |
" Requesting physical interface capabilities. This may take some time. requesting interface list via NETLINK 1 ERROR(s) during runtime root@OpenWrt:~/hcxdumptool |
Pushed an update to handle phy0 |
Now we check the interface index. |
"
WARNING: Variable 'wlan' does not exist or is not an array/object |
OpenWRT wifi configuration is affected too. /usr/share/hostap/wifi-detect.uc |
Looks like only kernel 5.15 is affected, while others are working fine. |
Confirmed. "
|
Great, glad that I could help. |
Right now, I'm refactoring hcxdumptool (hcxlabtool as test version has been pushed), |
" Requesting physical interface capabilities. This may take some time. available wlan devices: phy idx hw-mac virtual-mac m ifname driver (protocol)1 14 c87f54bd31aa c87f54bd31aa * phy1-ap0 mt798x-wmac (NETLINK)
Yeah! thanks a lot, a router without hcxdumptool and a 256gb usb3.2 disk, is not a proper router 🥇 |
I wouldn't call this a router... |
I've tested opwnwrt on different Raspberries ant can confirm this behavior: OpenWRT (23.05.0): first device = phy0 (what a surprise) On all distributions: first ifindex is always 1 (increase on every new connected or reconnected device) |
Reopened, due to a huge problem:
Using getifaddrs() doesn't show wlan1:
Regardless what I'm doing to detect the interface, If have to refactor the entire detection of interfaces. |
Looks like OpenWRT is doing something very special here:
Any ideas? I don't think that's the intention! |
I think I got a solution:
I can now retrieve all the information. But unfortunately, I have to hijack all unassigned interfaces to find the best one. |
bcm has monitor mode and injection via Nexmon |
Thanks for the information. Than I'll move from using IFINDEX:
to WIPHY:
Due to the same reasons I'll check if the user tries to run hcxdumptool on a VIF. If that is the case, I'll remove it. |
If you take a look at the latest commits on hcxlabtool you'll notice massive changed related to OpenWRT: Starting in February 2022, support for ARMv5 and ARMv6 architectures will be ended in Arch Linux ARM: |
Last but not least I got it. The problem is not related to hcxdumptool and there is no need to hijack devices that are not assigned. The real cause is related to OpenWRT's wireless configuration in /etc/config/wireless. By default the devices are configured to a PATH: A better solution e.g. for a Raspberry Pi Zero W (on board radio and one radio attached to the USB port) is to assign them to the physical address (phy).
Now the onboard device and an attached USB device are assigned and hcxdumptool is allowed to use them. Closed, because it issue is related to OpenWRTs configuration. |
Hi!
We seem to have an issue with listing adapters on OpenWRT at the momen. I attached the strace log from "hcxdumptool -i wlan0 -w capture.pcapng" cmd output/trace 👍
airmon-ng and everything else works fine, but hcxdumptool has issues calling "/sys/class/ieee80211/phy1/device/driver" it seems. finding adapters.
The text was updated successfully, but these errors were encountered: