summaryrefslogtreecommitdiffstats
path: root/lpf.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-06-30 18:54:31 +0000
committerRoy Marples <roy@marples.name>2008-06-30 18:54:31 +0000
commit5dd248bb688d479b791792024b3abe9a24982e7c (patch)
tree1a8b2e2fc1ef19f264cd0e2bcfe11607c526ba86 /lpf.c
parentd65fd32df0506c849262e1e63611c134db267745 (diff)
downloaddhcpcd-5dd248bb688d479b791792024b3abe9a24982e7c.tar.xz
Ensure we work if ARP compiled out but requested.
Diffstat (limited to 'lpf.c')
-rw-r--r--lpf.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lpf.c b/lpf.c
index e18e6eca..daa8a4c6 100644
--- a/lpf.c
+++ b/lpf.c
@@ -159,17 +159,16 @@ send_raw_packet(const struct interface *iface, int protocol,
}
ssize_t
-get_raw_packet(struct interface *iface, _unused int protocol,
- void *data, ssize_t len)
+get_raw_packet(struct interface *iface, int protocol, void *data, ssize_t len)
{
ssize_t bytes;
- int fd;
+ int fd = -1;
+ if (protocol == ETHERTYPE_ARP) {
#ifdef ENABLE_ARP
- if (protocol == ETHERTYPE_ARP)
fd = iface->arp_fd;
- else
#endif
+ } else
fd = iface->fd;
bytes = read(fd, data, len);
if (bytes == -1)