From 2200b68aff24f146574c71200c73c4e48a6ab30b Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Fri, 4 Apr 2014 03:55:32 -0400 Subject: [PATCH] Print a warning if the BPF is not installed for an ARP socket. --- ndhc/arp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ndhc/arp.c b/ndhc/arp.c index 50b0274..4bd1cca 100644 --- a/ndhc/arp.c +++ b/ndhc/arp.c @@ -151,6 +151,9 @@ static void arp_set_bpf_basic(int fd) }; using_arp_bpf = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, &sfp_arp, 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)