summaryrefslogtreecommitdiffstats
path: root/lpf.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-07-23 17:06:42 +0000
committerRoy Marples <roy@marples.name>2008-07-23 17:06:42 +0000
commitb8b4be9a39e91342c91e493ce2e08c00d0177aa8 (patch)
treeee2ad95243ab6b0c06485c227cd72ef96762936f /lpf.c
parent482f13c723f9353308e869d006771c717e440cd9 (diff)
downloaddhcpcd-b8b4be9a39e91342c91e493ce2e08c00d0177aa8.tar.xz
Remove #ifdefs to disable specific bits of code. We now build everything - we're small enough :)
Diffstat (limited to 'lpf.c')
-rw-r--r--lpf.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/lpf.c b/lpf.c
index 98521871..ae5dd036 100644
--- a/lpf.c
+++ b/lpf.c
@@ -89,13 +89,10 @@ open_socket(struct interface *iface, int protocol)
}
/* Install the DHCP filter */
memset(&pf, 0, sizeof(pf));
-#ifdef ENABLE_ARP
if (protocol == ETHERTYPE_ARP) {
pf.filter = UNCONST(arp_bpf_filter);
pf.len = arp_bpf_filter_len;
- } else
-#endif
- {
+ } else {
pf.filter = UNCONST(dhcp_bpf_filter);
pf.len = dhcp_bpf_filter_len;
}
@@ -107,11 +104,9 @@ open_socket(struct interface *iface, int protocol)
goto eexit;
if (bind(s, &su.sa, sizeof(su)) == -1)
goto eexit;
-#ifdef ENABLE_ARP
if (protocol == ETHERTYPE_ARP)
fd = &iface->arp_fd;
else
-#endif
fd = &iface->raw_fd;
if (*fd != -1)
close(*fd);
@@ -148,11 +143,9 @@ send_raw_packet(const struct interface *iface, int protocol,
&ipv4_bcast_addr, sizeof(ipv4_bcast_addr));
else
memset(&su.sll.sll_addr, 0xff, iface->hwlen);
-#ifdef ENABLE_ARP
if (protocol == ETHERTYPE_ARP)
fd = iface->arp_fd;
else
-#endif
fd = iface->raw_fd;
return sendto(fd, data, len, 0, &su.sa, sizeof(su));
@@ -164,11 +157,9 @@ get_raw_packet(struct interface *iface, int protocol, void *data, ssize_t len)
ssize_t bytes;
int fd = -1;
- if (protocol == ETHERTYPE_ARP) {
-#ifdef ENABLE_ARP
+ if (protocol == ETHERTYPE_ARP)
fd = iface->arp_fd;
-#endif
- } else
+ else
fd = iface->raw_fd;
bytes = read(fd, data, len);
if (bytes == -1)