From: Alan T. DeKok Date: Sun, 3 Mar 2013 04:12:43 +0000 (-0800) Subject: More descriptive debugging messages X-Git-Tag: release_2_2_1~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85b890b7ddbbac198fef69e76672c1ab875832e3;p=thirdparty%2Ffreeradius-server.git More descriptive debugging messages --- diff --git a/src/main/dhcpd.c b/src/main/dhcpd.c index 9313f63b4b8..88156336e5d 100644 --- a/src/main/dhcpd.c +++ b/src/main/dhcpd.c @@ -176,7 +176,7 @@ static int dhcprelay_process_server_reply(REQUEST *request) ((vp = pairfind(request->packet->vps, DHCP2ATTR(262))) /* DHCP-Flags */ && (vp->vp_integer & 0x8000) && ((vp = pairfind(request->packet->vps, DHCP2ATTR(263))) /* DHCP-Client-IP-Address */ && - (vp->vp_ipaddr == htonl(INADDR_ANY))))) { + (vp->vp_ipaddr == htonl(INADDR_ANY))))) { /* * RFC 2131, page 23 * @@ -185,6 +185,7 @@ static int dhcprelay_process_server_reply(REQUEST *request) * or * - Broadcast flag is set up and ciaddr == NULL */ + RDEBUG("DHCP: response will be broadcast"); request->packet->dst_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_BROADCAST); } else { /* @@ -204,6 +205,7 @@ static int dhcprelay_process_server_reply(REQUEST *request) return -1; } + RDEBUG("DHCP: response will be unicast to your-ip-address"); request->packet->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; /* @@ -397,7 +399,9 @@ static int dhcp_process(REQUEST *request) vp = pairfind(request->reply->vps, DHCP2ATTR(266)); /* DHCP-Gateway-IP-Address */ if (vp && (vp->vp_ipaddr != htonl(INADDR_ANY))) { /* Answer to client's nearest DHCP relay */ + RDEBUG("DHCP: Reply will be unicast to giaddr from original packet"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; + } else if ((request->reply->code == PW_DHCP_NAK) || ((vp = pairfind(request->reply->vps, DHCP2ATTR(262))) /* DHCP-Flags */ && (vp->vp_integer & 0x8000) && @@ -411,6 +415,7 @@ static int dhcp_process(REQUEST *request) * or * - Broadcast flag is set up and ciaddr == NULL */ + RDEBUG("DHCP: Reply will be broadcast"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_BROADCAST); } else { /* @@ -422,6 +427,7 @@ static int dhcp_process(REQUEST *request) */ if ((vp = pairfind(request->reply->vps, DHCP2ATTR(263))) /* DHCP-Client-IP-Address */ && (vp->vp_ipaddr != htonl(INADDR_ANY))) { + RDEBUG("DHCP: Reply will be sent unicast to client-ip-address"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; } else { vp = pairfind(request->reply->vps, DHCP2ATTR(264)); /* DHCP-Your-IP-Address */ @@ -430,6 +436,7 @@ static int dhcp_process(REQUEST *request) return -1; } + RDEBUG("DHCP: Reply will be sent unicast to your-ip-address"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; /*