https://bugs.winehq.org/show_bug.cgi?id=55487
--- Comment #1 from Alexis Murzeau amubtdx@gmail.com --- Created attachment 75050 --> https://bugs.winehq.org/attachment.cgi?id=75050 test_pcap.c program to test pcap_dispatch
The test_pcap program is a test that does this: - Capture packets using pcap_dispatch with count set to -1 (to process all packets at once) - Send a packet with ether_type 0x1234 to have at least one packet to receive in pcap_dispatch - Each time a packet is received in pcap_dispatch, a new packet is sent with pcap_sendpacket and ether_type 0x1234
The test_pcap program should do this (this is what it does when compiled for Linux, note that it requires either root or CAP_SYS_ADMIN for example): ``` # ./test_pcap wlan0 Will use a 2 differents pcap_t instances, one for pcap_dispatch and one for pcap_sendpacket received packet with size: 14, ether_type: 0x1234 received packet with size: 14, ether_type: 0x1234 [... repeated line "received packet" ] ```
But with Wine, it shows this instead (which mean pcap_dispatch doesn't process any packets) (note that /opt/wine-staging/bin/wine64-preloader needs CAP_NET_RAW, and that setcap needs the actual file and not a symlink):
``` # setcap cap_net_raw+epi /opt/wine-staging/bin/wine64-preloader $ wine ./test_pcap.exe 1 List of interfaces with interface number: 1. \Device\NPF_{00000003-0000-0000-0000-4E6574446576} (wlx00c0cab1aa57) 2. \Device\NPF_{00000001-0000-0000-0000-4E6574446576} (lo) 3. \Device\NPF_{00000002-0000-0000-0000-4E6574446576} (enp34s0)
Will use a 2 differents pcap_t instances, one for pcap_dispatch and one for pcap_sendpacket pcap_dispatch processed 0 packets [... repeated above line, there is no "received packet" line ] ```
Compilation instruction are in comments inside test_pcap.c.