diff options
Diffstat (limited to 'src/dhcpv4.c')
-rw-r--r-- | src/dhcpv4.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dhcpv4.c b/src/dhcpv4.c index 7ac7af9..2b2f41e 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -897,12 +897,14 @@ void dhcpv4_handle_msg(void *addr, void *data, size_t len, dest.sin_addr = reply.yiaddr; dest.sin_port = htons(DHCPV4_CLIENT_PORT); - memcpy(arp.arp_ha.sa_data, req->chaddr, 6); - memcpy(&arp.arp_pa, &dest, sizeof(arp.arp_pa)); - memcpy(arp.arp_dev, iface->ifname, sizeof(arp.arp_dev)); + if (!(iface->ifflags & IFF_NOARP)) { + memcpy(arp.arp_ha.sa_data, req->chaddr, 6); + memcpy(&arp.arp_pa, &dest, sizeof(arp.arp_pa)); + memcpy(arp.arp_dev, iface->ifname, sizeof(arp.arp_dev)); - if (ioctl(sock, SIOCSARP, &arp) < 0) - syslog(LOG_ERR, "ioctl(SIOCSARP): %m"); + if (ioctl(sock, SIOCSARP, &arp) < 0) + syslog(LOG_ERR, "ioctl(SIOCSARP): %m"); + } } if (send_reply(&reply, PACKET_SIZE(&reply, cookie), |