summaryrefslogtreecommitdiffstats
path: root/bpf.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-05-14 12:05:04 +0000
committerRoy Marples <roy@marples.name>2008-05-14 12:05:04 +0000
commita1613b91fd34b5cb904a3f8b278c7b9b2fff2f87 (patch)
treed43205d36456dc4fa28448e12afa07a2ab08360c /bpf.c
parent45e1c85466284a8c0061be1be0e49dfae33d0550 (diff)
downloaddhcpcd-a1613b91fd34b5cb904a3f8b278c7b9b2fff2f87.tar.xz
Prettify code a little.
Diffstat (limited to 'bpf.c')
-rw-r--r--bpf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bpf.c b/bpf.c
index fb483f17..470ad22c 100644
--- a/bpf.c
+++ b/bpf.c
@@ -103,15 +103,15 @@ open_socket(struct interface *iface, int protocol)
/* Install the DHCP filter */
if (protocol == ETHERTYPE_ARP) {
pf.bf_insns = arp_bpf_filter;
- pf.bf_len = sizeof(arp_bpf_filter) / sizeof(arp_bpf_filter[0]);
+ pf.bf_len = arp_bpf_filter_len;
} else {
pf.bf_insns = dhcp_bpf_filter;
- pf.bf_len = sizeof(dhcp_bpf_filter)/sizeof(dhcp_bpf_filter[0]);
+ pf.bf_len = dhcp_bpf_filter_len;
}
if (ioctl(fd, BIOCSETF, &pf) == -1)
goto eexit;
- if (iface->fd > -1)
+ if (iface->fd != -1)
close(iface->fd);
close_on_exec(fd);
@@ -136,7 +136,7 @@ send_raw_packet(const struct interface *iface, int type,
hw.ether_type = htons(type);
iov[0].iov_base = &hw;
iov[0].iov_len = sizeof(hw);
- iov[1].iov_base = (unsigned char *)data;
+ iov[1].iov_base = UNCONST(data);
iov[1].iov_len = len;
return writev(iface->fd, iov, 2);