From: Roy Marples Date: Thu, 10 Jul 2008 15:32:03 +0000 (+0000) Subject: Fix sending of ARP packets. X-Git-Tag: v4.0.2~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dca5f15979da882c8d2b3fdf471c3410f64f996a;p=thirdparty%2Fdhcpcd.git Fix sending of ARP packets. --- diff --git a/bpf.c b/bpf.c index f015344b..e37b5073 100644 --- a/bpf.c +++ b/bpf.c @@ -142,6 +142,7 @@ send_raw_packet(const struct interface *iface, int protocol, { struct iovec iov[2]; struct ether_header hw; + int fd; memset(&hw, 0, ETHER_HDR_LEN); memset(&hw.ether_dhost, 0xff, ETHER_ADDR_LEN); @@ -150,7 +151,13 @@ send_raw_packet(const struct interface *iface, int protocol, iov[0].iov_len = ETHER_HDR_LEN; iov[1].iov_base = UNCONST(data); iov[1].iov_len = len; - return writev(iface->fd, iov, 2); +#ifdef ENABLE_ARP + if (protocol == ETHERTYPE_ARP) + fd = iface->arp_fd; + else +#endif + fd = iface->fd; + return writev(fd, iov, 2); } /* BPF requires that we read the entire buffer.