diff options
| author | Roy Marples <roy@marples.name> | 2008-07-10 15:32:03 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-07-10 15:32:03 +0000 |
| commit | dca5f15979da882c8d2b3fdf471c3410f64f996a (patch) | |
| tree | 93c49b7c0c7c067cb1f273dc80ca7fc8661febbb /bpf.c | |
| parent | 6c738c7f9efef4523256517ad63b272c26f5e4ce (diff) | |
| download | dhcpcd-dca5f15979da882c8d2b3fdf471c3410f64f996a.tar.xz | |
Fix sending of ARP packets.
Diffstat (limited to 'bpf.c')
| -rw-r--r-- | bpf.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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. |
