dhcp server - some patches

Haralds Ulmanis ezh at telcobalt.lv
Mon Jun 23 13:39:11 CEST 2008


Another patch :) for dhcp.c
updates to receive offer message and removes some garbage code (maybe it was 
here for testing ?). vp->vp_integer and packet->code - PW_DHCP_OFFSET always 
will be equal. with my dhcpd.c patch :) 
--- dhcp.c      2008-06-23 14:26:45.000000000 +0300
+++ dhcp_new.c  2008-06-23 14:30:01.000000000 +0300
@@ -190,7 +190,7 @@
        if ((packet->data[240] != 53) ||
            (packet->data[241] != 1) ||
            (packet->data[242] == 0) ||
-           (packet->data[242] >= 8)) {
+           (packet->data[242] > 8)) {
                fprintf(stderr, "Unknown, or badly formatted DHCP packet\n");
                rad_free(&packet);
                return NULL;
@@ -958,11 +958,6 @@
                p = pp;
        }

-       vp = pairfind(packet->vps, DHCP2ATTR(53));
-       if (vp && (vp->vp_integer != (packet->code - PW_DHCP_OFFSET))) {
-               fprintf(stderr, "Message-Type doesn't match! %d %d\n",
-                       packet->code, vp->vp_integer);
-       }
        pairdelete(&packet->vps, DHCP2ATTR(0x35));

        /*



More information about the Freeradius-Users mailing list