Skip to content

Commit

Permalink
If relay IP is 0.0.0.0, don't use it
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Mar 14, 2014
1 parent 2027092 commit a3c25c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/proto_dhcp/dhcpd.c
Expand Up @@ -457,7 +457,7 @@ static int dhcp_process(REQUEST *request)
* public IP, but the gateway a private one.
*/
vp = pairfind(request->reply->vps, 272, DHCP_MAGIC_VENDOR, TAG_ANY); /* DHCP-Relay-IP-Address */
if (vp) {
if (vp && (vp->vp_ipaddr != ntohl(INADDR_ANY))) {
RDEBUG("DHCP: Reply will be unicast to giaddr from original packet");
request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr;
return 1;
Expand Down

0 comments on commit a3c25c7

Please sign in to comment.