From: Stephen R. van den Berg Date: Sat, 9 Jul 2011 10:40:27 +0000 (+0200) Subject: DHCP compile fixes X-Git-Tag: release_3_0_0_beta0~715 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39bc3a7fc46eb13d0f4b192b7e409c09159552fe;p=thirdparty%2Ffreeradius-server.git DHCP compile fixes --- diff --git a/src/include/dhcp.h b/src/include/dhcp.h index 63ab5e96b71..4305c0d70ca 100644 --- a/src/include/dhcp.h +++ b/src/include/dhcp.h @@ -62,7 +62,7 @@ int fr_dhcp_decode(RADIUS_PACKET *packet); #define DHCP_UNPACK_OPTION1(x) (((x) & 0xff00) >> 8) #define PW_DHCP_MESSAGE_TYPE (53) -#define PW_DHCP_YOU_IP_ADDRESS (264) +#define PW_DHCP_YOUR_IP_ADDRESS (264) #define PW_DHCP_SUBNET_MASK (1) #define PW_DHCP_IP_ADDRESS_LEASE_TIME (51) diff --git a/src/lib/dhcp.c b/src/lib/dhcp.c index d234d6017ad..58791350c7f 100644 --- a/src/lib/dhcp.c +++ b/src/lib/dhcp.c @@ -1141,7 +1141,7 @@ int fr_dhcp_encode(RADIUS_PACKET *packet, RADIUS_PACKET *original) } } - vp = pairfind(packet->vps, DHCP2ATTR(256)); + vp = pairfind(packet->vps, 256, DHCP_MAGIC_VENDOR); if (vp) { *p++ = vp->vp_integer & 0xff; } else { @@ -1154,7 +1154,7 @@ int fr_dhcp_encode(RADIUS_PACKET *packet, RADIUS_PACKET *original) *p++ = 1; /* hardware type = ethernet */ *p++ = 6; /* 6 bytes of ethernet */ - vp = pairfind(packet->vps, DHCP2ATTR(259)); + vp = pairfind(packet->vps, 259, DHCP_MAGIC_VENDOR); if (vp) { *p++ = vp->vp_integer & 0xff; } else { diff --git a/src/main/dhcpd.c b/src/main/dhcpd.c index c216bcfadd1..5af566d1f73 100644 --- a/src/main/dhcpd.c +++ b/src/main/dhcpd.c @@ -107,7 +107,7 @@ static int dhcp_process(REQUEST *request) /* * Hop count goes up. */ - vp = pairfind(request->reply->vps, DHCP2ATTR(259)); + vp = pairfind(request->reply->vps, 259, DHCP_MAGIC_VENDOR); if (vp) vp->vp_integer++; return 1; @@ -123,7 +123,7 @@ static int dhcp_process(REQUEST *request) * server. So we must be the destination of the * giaddr field. */ - pairdelete(&request->packet->vps, DHCP2ATTR(266)); + pairdelete(&request->packet->vps, 266, DHCP_MAGIC_VENDOR); rad_free(&request->reply); request->reply = request->packet; @@ -132,7 +132,7 @@ static int dhcp_process(REQUEST *request) /* * Search for client IP address. */ - vp = pairfind(request->packet->vps, DHCP2ATTR(264)); + vp = pairfind(request->packet->vps, 264, DHCP_MAGIC_VENDOR); if (!vp) { request->reply->code = 0; RDEBUG("DHCP: No YIAddr in the reply. Discarding packet"); @@ -151,7 +151,7 @@ static int dhcp_process(REQUEST *request) /* * Hop count goes down. */ - vp = pairfind(request->reply->vps, DHCP2ATTR(259)); + vp = pairfind(request->reply->vps, 259, DHCP_MAGIC_VENDOR); if (vp && (vp->vp_integer > 0)) vp->vp_integer--; /*