#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
+#include <arpa/inet.h>
#include <linux/can.h>
#include <linux/can/raw.h>
static int
can_activate(pcap_t* handle)
{
- int err = PCAP_ERROR;
struct sockaddr_can addr;
struct ifreq ifr;
/* get interface index */
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, handle->opt.source, sizeof(ifr.ifr_name));
- if ((handle->fd, SIOCGIFINDEX, &ifr) < 0)
+ if (ioctl(handle->fd, SIOCGIFINDEX, &ifr) < 0)
{
snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
"Unable to get interface index: %s",
{
struct msghdr msg;
struct pcap_pkthdr pkth;
- struct timeval tv;
struct iovec iv;
struct can_frame* cf;