summaryrefslogtreecommitdiff
path: root/src/bpf.c
diff options
context:
space:
mode:
authorSeonah Moon <seonah1.moon@samsung.com>2018-06-21 15:44:41 +0900
committerSeonah Moon <seonah1.moon@samsung.com>2018-06-21 15:45:21 +0900
commit2b5ed83fec55f5d96338fe3ae5e394bed1a407f4 (patch)
treed3d74be1606f40615be2a5693efda635a3053c43 /src/bpf.c
parent0ebdbc1d2fd08c1de37fa314ea02b51085dfb3d9 (diff)
downloaddnsmasq-2b5ed83fec55f5d96338fe3ae5e394bed1a407f4.tar.gz
dnsmasq-2b5ed83fec55f5d96338fe3ae5e394bed1a407f4.tar.bz2
dnsmasq-2b5ed83fec55f5d96338fe3ae5e394bed1a407f4.zip
Imported Upstream version 2.79upstream/2.79
Change-Id: I9a2f4c945e0481ab803bdf0c85921433f33a9256 Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
Diffstat (limited to 'src/bpf.c')
-rw-r--r--src/bpf.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bpf.c b/src/bpf.c
index a066641..49a11bf 100644
--- a/src/bpf.c
+++ b/src/bpf.c
@@ -1,4 +1,4 @@
-/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+/* dnsmasq is Copyright (c) 2000-2018 Simon Kelley
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,9 @@
#include <ifaddrs.h>
#include <sys/param.h>
+#if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__)
#include <sys/sysctl.h>
+#endif
#include <net/if.h>
#include <net/route.h>
#include <net/if_dl.h>
@@ -103,7 +105,7 @@ int arp_enumerate(void *parm, int (*callback)())
int iface_enumerate(int family, void *parm, int (*callback)())
{
struct ifaddrs *head, *addrs;
- int errsav, fd = -1, ret = 0;
+ int errsave, fd = -1, ret = 0;
if (family == AF_UNSPEC)
#if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__)
@@ -235,11 +237,11 @@ int iface_enumerate(int family, void *parm, int (*callback)())
ret = 1;
err:
- errsav = errno;
+ errsave = errno;
freeifaddrs(head);
if (fd != -1)
close(fd);
- errno = errsav;
+ errno = errsave;
return ret;
}