Skip to content

pcap_next_ex not returning -1? #217

@gabbiccino

Description

@gabbiccino

Hi,

We are seeing an issue currently where our application is not handling a network interface reconnection as well as it used to, and believe it may be related to a recent change in npcap.

With npcap 0.9991, we found that pcap_next_ex returned -1 when a network device was disabled. Our app then exited the loop and created a new handle and capture for the device once re-enabled.

With 0.9995 (we've also tried 0.9993-0.9994), it seems to only return 0 (timeout) when a device is disconnected.

I've recreated the same issue by using the basic_dump_ex example from the npcap repo. When testing with 0.9991 installed, the code reaches this line and exits when the monitored device is disabled: https://github.com/nmap/npcap/blob/master/Examples-pcap/basic_dump_ex/basic_dump_ex.c#L127

With 0.9995 I find that the example code continues indefinitely.

Please could someone advise on this issue? It could be related to our setup, but from our testing there appears to be a difference in how the two versions handle disconnected devices.

Many thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions