]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
BIOCIMMEDIATE isn't always available
authorRoy Marples <roy@marples.name>
Wed, 14 May 2008 11:53:58 +0000 (11:53 +0000)
committerRoy Marples <roy@marples.name>
Wed, 14 May 2008 11:53:58 +0000 (11:53 +0000)
bpf.c

diff --git a/bpf.c b/bpf.c
index 8dc2c319e54ca65f347f6226675bc4940fe8ca29..fb483f17241271535abcec87885af6e756f9cd1a 100644 (file)
--- 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) {