From: Felix Fietkau Date: Wed, 11 Aug 2010 02:12:17 +0000 (+0200) Subject: Learn the ARP entry of the DHCP server directly from the DHCP response X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fba3e8d167c037bdbb29ea79c483c10b8f9f2d02;p=project%2Frelayd.git Learn the ARP entry of the DHCP server directly from the DHCP response --- diff --git a/main.c b/main.c index f0630ae..a29be2c 100644 --- a/main.c +++ b/main.c @@ -536,6 +536,9 @@ static bool forward_dhcp_packet(struct relayd_interface *rif, void *data, int le if (!forward_dhcp) return true; + if (dhcp->op == 2) + refresh_host(rif, pkt->eth.ether_shost, (void *) &pkt->iph.saddr); + DPRINTF(2, "%s: handling DHCP %s\n", rif->ifname, (dhcp->op == 1 ? "request" : "response")); dhcp->flags |= htons(DHCP_FLAG_BROADCAST);