Merge pull request #115 from paldier/patch-1

Fix compile error on libpcap < 1.9.0
This commit is contained in:
Joseph C. Lehner 2022-11-01 13:53:57 +01:00 committed by GitHub
commit ae9d8fa325
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -586,6 +586,7 @@ bool ethsock_is_wifi(struct ethsock *sock)
bool ethsock_is_unplugged(struct ethsock *sock)
{
#ifdef PCAP_IF_WIRELESS
bpf_u_int32 flags;
if (!intf_get_pcap_flags(sock->intf, &flags)) {
@ -593,6 +594,10 @@ bool ethsock_is_unplugged(struct ethsock *sock)
}
return flags & PCAP_IF_CONNECTION_STATUS_DISCONNECTED;
#else
#warning "libpcap version is < 1.9.0"
return false;
#endif
}
struct ethsock *ethsock_create(const char *intf, uint16_t protocol)