2

I have libpcap version 0.6 and linux kernel version 2.6.18 in which i cannot upgrade either of these and pcap_breakloop() function available from the version 0.8.

My question is how can I break pcap_loop() without using pcap_breakloop()?

Any help will be appreciated.

Kothari
  • 91
  • 1
  • 9

1 Answers1

1

Longer answer: you can't, but what you could try is writing your own loop, using pcap_dispatch(), and check a "should I break out of the loop?" flag before each call to pcap_dispatch().

This isn't as good, as pcap_dispatch() might also loop, and that wouldn't break out of the loop, although, in libpcap 0.6 (which is REALLY old, BTW - older than the 2.6.18 kernel, as far as I know), it doesn't loop on Linux.