From d85c5a766e5fbd50926a2fc669ce5e9c39fbbc48 Mon Sep 17 00:00:00 2001 From: paldier Date: Tue, 1 Nov 2022 13:44:07 +0800 Subject: [PATCH] Fix compile error on libpcap < 1.9.0 --- ethsock.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ethsock.c b/ethsock.c index d53826d..e10c214 100644 --- a/ethsock.c +++ b/ethsock.c @@ -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)