Change #208555
Category | libpcap |
Changed by | Guy Harris <gharris | @sonic.net>
Changed at | Mon 23 Sep 2024 22:28:10 |
Repository | https://git.tcpdump.org/libpcap |
Project | libpcap |
Branch | master |
Revision | 24cf361c4d843d620acadc0ff0977dc2364ee81e |
Comments
linux: fix check for mac80211 phydev. If pcap_create() is passed an invalid interface name, have pcap_can_set_rfmon() fail with PCAP_ERROR_NO_SUCH_DEVICE rather than reporting "this doesn't support monitor mode", and have an attempt to enter monitor mode in pcap_activate() return PCAP_ERROR_NO_SUCH_DEVICE rather than PCAP_ERROR_RFMON_NOTSUP. This fixes a bug wherein tcpdump, when pased an interface index as an argument to -i, and also passed -I, would report that the device can't support monitor mode, even if that index corresponds to a device that *can* support monitor mode, rather than attempting to open the device and put the device into monitor mode. (Given that on some OSes an interface can have a purely-numeric name, when given a numeric argument to -i, it first tries to open it as a device and, if that gets a "no such device" error, it tries to interpret it as a device index. And, given that Linux systems can have device names such as wlx0013eff12e78, Windows isn't the only OS in which ugly long device names make device indices convenient alternatives to device names.)
Changed files
- pcap-linux.c