summaryrefslogtreecommitdiffstats
path: root/bpf.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-05-14 11:53:58 +0000
committerRoy Marples <roy@marples.name>2008-05-14 11:53:58 +0000
commit45e1c85466284a8c0061be1be0e49dfae33d0550 (patch)
tree192a8ca930802e1419df8bac5e85f481220747da /bpf.c
parentbf6c0cfe0c1fd556f3b9353e36346946d91cac55 (diff)
downloaddhcpcd-45e1c85466284a8c0061be1be0e49dfae33d0550.tar.xz
BIOCIMMEDIATE isn't always available
Diffstat (limited to 'bpf.c')
-rw-r--r--bpf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bpf.c b/bpf.c
index 8dc2c319..fb483f17 100644
--- a/bpf.c
+++ b/bpf.c
@@ -52,12 +52,13 @@ int
open_socket(struct interface *iface, int protocol)
{
int fd = -1;
- int flags;
struct ifreq ifr;
int buf = 0;
struct bpf_version pv;
struct bpf_program pf;
-
+#ifdef BIOCIMMEDIATE
+ int flags;
+#endif
#ifdef _PATH_BPF
fd = open(_PATH_BPF, O_RDWR);
#else
@@ -93,9 +94,11 @@ open_socket(struct interface *iface, int protocol)
goto eexit;
iface->buffer_length = buf;
+#ifdef BIOCIMMEDIATE
flags = 1;
if (ioctl(fd, BIOCIMMEDIATE, &flags) == -1)
goto eexit;
+#endif
/* Install the DHCP filter */
if (protocol == ETHERTYPE_ARP) {