mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 14:25:41 +00:00
Supply Requested Address from ciaddr; reflect server identifier
This commit is contained in:
@@ -190,6 +190,7 @@ void bootp (packet)
|
|||||||
void dhcp (packet)
|
void dhcp (packet)
|
||||||
struct packet *packet;
|
struct packet *packet;
|
||||||
{
|
{
|
||||||
|
note ("got a dhcp packet: %d", packet -> packet_type);
|
||||||
switch (packet -> packet_type) {
|
switch (packet -> packet_type) {
|
||||||
case DHCPOFFER:
|
case DHCPOFFER:
|
||||||
dhcpoffer (packet);
|
dhcpoffer (packet);
|
||||||
@@ -338,6 +339,7 @@ void send_request (packet)
|
|||||||
struct tree_cache dhcprequest_tree;
|
struct tree_cache dhcprequest_tree;
|
||||||
struct tree_cache dhcprqo_tree;
|
struct tree_cache dhcprqo_tree;
|
||||||
struct tree_cache dhcprqa_tree;
|
struct tree_cache dhcprqa_tree;
|
||||||
|
struct tree_cache dhcpsid_tree;
|
||||||
|
|
||||||
memset (options, 0, sizeof options);
|
memset (options, 0, sizeof options);
|
||||||
memset (&outgoing, 0, sizeof outgoing);
|
memset (&outgoing, 0, sizeof outgoing);
|
||||||
@@ -360,16 +362,26 @@ void send_request (packet)
|
|||||||
options [DHO_DHCP_MESSAGE] -> timeout = 0xFFFFFFFF;
|
options [DHO_DHCP_MESSAGE] -> timeout = 0xFFFFFFFF;
|
||||||
options [DHO_DHCP_MESSAGE] -> tree = (struct tree *)0;
|
options [DHO_DHCP_MESSAGE] -> tree = (struct tree *)0;
|
||||||
|
|
||||||
|
/* Request the address we were offered... */
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] = &dhcprqa_tree;
|
options [DHO_DHCP_REQUESTED_ADDRESS] = &dhcprqa_tree;
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> value =
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> value =
|
||||||
packet -> options [DHO_DHCP_REQUESTED_ADDRESS].data;
|
(unsigned char *)&packet -> raw -> yiaddr;
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> len =
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> len = 4;
|
||||||
packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len;
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> buf_size = 4;
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> buf_size =
|
|
||||||
packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len;
|
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> timeout = 0xFFFFFFFF;
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> timeout = 0xFFFFFFFF;
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> tree = (struct tree *)0;
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> tree = (struct tree *)0;
|
||||||
|
|
||||||
|
/* Send back the server identifier... */
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] = &dhcpsid_tree;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> value =
|
||||||
|
packet -> options [DHO_DHCP_SERVER_IDENTIFIER].data;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> len =
|
||||||
|
packet -> options [DHO_DHCP_SERVER_IDENTIFIER].len;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> buf_size =
|
||||||
|
packet -> options [DHO_DHCP_SERVER_IDENTIFIER].len;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> timeout = 0xFFFFFFFF;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> tree = (struct tree *)0;
|
||||||
|
|
||||||
/* Set up the option buffer... */
|
/* Set up the option buffer... */
|
||||||
cons_options ((struct packet *)0, &outgoing, options, 0);
|
cons_options ((struct packet *)0, &outgoing, options, 0);
|
||||||
|
|
||||||
|
22
dhclient.c
22
dhclient.c
@@ -190,6 +190,7 @@ void bootp (packet)
|
|||||||
void dhcp (packet)
|
void dhcp (packet)
|
||||||
struct packet *packet;
|
struct packet *packet;
|
||||||
{
|
{
|
||||||
|
note ("got a dhcp packet: %d", packet -> packet_type);
|
||||||
switch (packet -> packet_type) {
|
switch (packet -> packet_type) {
|
||||||
case DHCPOFFER:
|
case DHCPOFFER:
|
||||||
dhcpoffer (packet);
|
dhcpoffer (packet);
|
||||||
@@ -338,6 +339,7 @@ void send_request (packet)
|
|||||||
struct tree_cache dhcprequest_tree;
|
struct tree_cache dhcprequest_tree;
|
||||||
struct tree_cache dhcprqo_tree;
|
struct tree_cache dhcprqo_tree;
|
||||||
struct tree_cache dhcprqa_tree;
|
struct tree_cache dhcprqa_tree;
|
||||||
|
struct tree_cache dhcpsid_tree;
|
||||||
|
|
||||||
memset (options, 0, sizeof options);
|
memset (options, 0, sizeof options);
|
||||||
memset (&outgoing, 0, sizeof outgoing);
|
memset (&outgoing, 0, sizeof outgoing);
|
||||||
@@ -360,16 +362,26 @@ void send_request (packet)
|
|||||||
options [DHO_DHCP_MESSAGE] -> timeout = 0xFFFFFFFF;
|
options [DHO_DHCP_MESSAGE] -> timeout = 0xFFFFFFFF;
|
||||||
options [DHO_DHCP_MESSAGE] -> tree = (struct tree *)0;
|
options [DHO_DHCP_MESSAGE] -> tree = (struct tree *)0;
|
||||||
|
|
||||||
|
/* Request the address we were offered... */
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] = &dhcprqa_tree;
|
options [DHO_DHCP_REQUESTED_ADDRESS] = &dhcprqa_tree;
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> value =
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> value =
|
||||||
packet -> options [DHO_DHCP_REQUESTED_ADDRESS].data;
|
(unsigned char *)&packet -> raw -> yiaddr;
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> len =
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> len = 4;
|
||||||
packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len;
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> buf_size = 4;
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> buf_size =
|
|
||||||
packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len;
|
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> timeout = 0xFFFFFFFF;
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> timeout = 0xFFFFFFFF;
|
||||||
options [DHO_DHCP_REQUESTED_ADDRESS] -> tree = (struct tree *)0;
|
options [DHO_DHCP_REQUESTED_ADDRESS] -> tree = (struct tree *)0;
|
||||||
|
|
||||||
|
/* Send back the server identifier... */
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] = &dhcpsid_tree;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> value =
|
||||||
|
packet -> options [DHO_DHCP_SERVER_IDENTIFIER].data;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> len =
|
||||||
|
packet -> options [DHO_DHCP_SERVER_IDENTIFIER].len;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> buf_size =
|
||||||
|
packet -> options [DHO_DHCP_SERVER_IDENTIFIER].len;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> timeout = 0xFFFFFFFF;
|
||||||
|
options [DHO_DHCP_SERVER_IDENTIFIER] -> tree = (struct tree *)0;
|
||||||
|
|
||||||
/* Set up the option buffer... */
|
/* Set up the option buffer... */
|
||||||
cons_options ((struct packet *)0, &outgoing, options, 0);
|
cons_options ((struct packet *)0, &outgoing, options, 0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user