ThomasHabets / arping

ARP Ping
http://www.habets.pp.se/synscan/programs.php
GNU General Public License v2.0
403 stars 63 forks source link

Augment return value check of pcap_next_ex #45

Closed PeiweiHu closed 2 years ago

PeiweiHu commented 2 years ago

Although the document of libpcap says pcap_next_ex returns 1 on success. In fact, it returns >0 on success. So it's better to change the return value check to >0.

See:

ThomasHabets commented 2 years ago

Ugh, it's not the first time their docs are wrong.

Thanks.

I've also opened a pull request to fix their docs.

PeiweiHu commented 2 years ago

Ugh, it's not the first time their docs are wrong.

Thanks.

I've also opened a pull request to fix their docs.

ok, I opened an issue too. https://github.com/the-tcpdump-group/libpcap/issues/1059. You can quote in your PR. :-)

ThomasHabets commented 2 years ago

Yup, found it and already did.

guyharris commented 2 years ago

In fact, it returns >0 on success

1 > 0; under what circumstances have you found that it returns a value > 1?

PeiweiHu commented 2 years ago

Ugh, it's not the first time their docs are wrong.

Thanks.

I've also opened a pull request to fix their docs.

I forgot that only cnt=1 is passed to pcap_offline_read. Sorry for bothering you. orz