X-Git-Url: http://git.archive.openwrt.org/?p=project%2Frelayd.git;a=blobdiff_plain;f=main.c;h=a29be2c1e733830c787e7680ac3faeba2e25eb4f;hp=15935834b773c7952549044c9b36e318187c65a0;hb=fba3e8d167c037bdbb29ea79c483c10b8f9f2d02;hpb=5455abb3e575a1f6a0458097fb84857871d2f544 diff --git a/main.c b/main.c index 1593583..a29be2c 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2010 Felix Fietkau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License v2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * + */ #include #include @@ -519,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);