]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
More descriptive debugging messages
authorAlan T. DeKok <aland@freeradius.org>
Sun, 3 Mar 2013 04:12:43 +0000 (20:12 -0800)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 3 Mar 2013 04:12:43 +0000 (20:12 -0800)
src/main/dhcpd.c

index 9313f63b4b8f2255ef53d15817b3bc8478da127f..88156336e5d48dea65b35baa71804b982972009d 100644 (file)
@@ -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;
 
                        /*