int fd_opts;
#endif
+ bpf = calloc(1, sizeof(*bpf));
+ if (bpf == NULL)
+ return NULL;
+ bpf->bpf_ifp = ifp;
+
#ifdef _PATH_BPF
- fd = open(_PATH_BPF, O_RDWR | O_NONBLOCK
+ bpf->bpf_fd = open(_PATH_BPF, O_RDWR | O_NONBLOCK
#ifdef O_CLOEXEC
| O_CLOEXEC
#endif
char device[32];
int n = 0;
- bpf = calloc(1, sizeof(*bpf));
- if (bpf == NULL)
- return NULL;
- bpf->bpf_ifp = ifp;
-
do {
snprintf(device, sizeof(device), "/dev/bpf%d", n++);
bpf->bpf_fd = open(device, O_RDWR | O_NONBLOCK
#endif
#ifdef ARP
-#ifndef KERNEL_RFC5227
+#ifdef KERNEL_RFC5227
+static void
+dhcp_arp_announced(struct arp_state *state)
+{
+
+ arp_free(state);
+}
+#else
static void
dhcp_arp_defend_failed(struct arp_state *astate)
{
}
#endif
-#ifdef KERNEL_RFC5227
-static void
-dhcp_arp_announced(struct arp_state *state)
-{
-
- arp_free(state);
-}
-#endif /* KERNEL_RFC5227 */
#endif /* ARP */
void
#ifdef SO_RERROR
n = 1;
if (setsockopt(ctx->link_fd, SOL_SOCKET, SO_RERROR, &n,sizeof(n)) == -1)
- goto errexit;
+ logerr("%s: SO_RERROR", __func__);
#endif
/* Ignore our own route(4) messages.
#if !defined(HAVE_SOCK_CLOEXEC) || !defined(HAVE_SOCK_NONBLOCK)
int xflags, xtype = type;
#endif
-#ifdef SO_RERROR
- int on;
-#endif
#ifndef HAVE_SOCK_CLOEXEC
if (xtype & SOCK_CLOEXEC)