Fix compile error on libpcap < 1.9.0
This commit is contained in:
parent
25e2364930
commit
d85c5a766e
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue