]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-netmap.c
Fix building without protochain support. (GH #852)
[libpcap] / pcap-netmap.c
index ff9e79cb40f6e843ed90facb956ad19be160a87e..27d36e5bb6d31b678e875887a5e9941f5540090c 100644 (file)
@@ -29,7 +29,6 @@
 #endif
 
 #include <poll.h>
-#include <ctype.h>
 #include <errno.h>
 #include <netdb.h>
 #include <stdio.h>
@@ -67,7 +66,7 @@ pcap_netmap_stats(pcap_t *p, struct pcap_stat *ps)
 {
        struct pcap_netmap *pn = p->priv;
 
-       ps->ps_recv = pn->rx_pkts;
+       ps->ps_recv = (u_int)pn->rx_pkts;
        ps->ps_drop = 0;
        ps->ps_ifdrop = 0;
        return 0;
@@ -287,7 +286,7 @@ pcap_netmap_create(const char *device, char *ebuf, int *is_ours)
        *is_ours = (!strncmp(device, "netmap:", 7) || !strncmp(device, "vale", 4));
        if (! *is_ours)
                return NULL;
-       p = pcap_create_common(ebuf, sizeof (struct pcap_netmap));
+       p = PCAP_CREATE_COMMON(ebuf, struct pcap_netmap);
        if (p == NULL)
                return (NULL);
        p->activate_op = pcap_netmap_activate;