Print a warning if the BPF is not installed for an ARP socket.

This commit is contained in:
Nicholas J. Kain 2014-04-04 03:55:32 -04:00
parent dc2ac46fd4
commit 2200b68aff

View File

@ -151,6 +151,9 @@ static void arp_set_bpf_basic(int fd)
}; };
using_arp_bpf = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, &sfp_arp, using_arp_bpf = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, &sfp_arp,
sizeof sfp_arp) != -1; sizeof sfp_arp) != -1;
if (!using_arp_bpf)
log_warning("%s: Failed to set BPF for ARP socket: %s",
client_config.interface, strerror(errno));
} }
static void arp_set_bpf_defense(struct client_state_t *cs, int fd) static void arp_set_bpf_defense(struct client_state_t *cs, int fd)