[dhcp-agent-commits] dhcp-agent/src dhcp-client-states.c,1.25,1.26
Status: Alpha
Brought to you by:
actmodern
|
From: <act...@us...> - 2003-03-25 20:29:24
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src
In directory sc8-pr-cvs1:/tmp/cvs-serv10086
Modified Files:
dhcp-client-states.c
Log Message:
brought in line with recent conf changes; client_check_requested_options now checks required configuration or falls back on requested configuration
Index: dhcp-client-states.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-states.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** dhcp-client-states.c 25 Mar 2003 03:06:42 -0000 1.25
--- dhcp-client-states.c 25 Mar 2003 20:29:16 -0000 1.26
***************
*** 176,190 ****
char *ip_addr_string;
uint8_t *required_options;
! uint8_t received_options[MAX_OPTIONS_HANDLED + 1];
dhcp_option_t *dhcp_option;
int i;
/* get the mac address, and ip address from the packet. */
-
ip_addr = ip_get_src_addr(dc->rawnet->ip_p);
eth_addr = eth_get_src_addr(dc->rawnet->ether_p);
! /* build our received options array. */
memset(received_options, 0, sizeof(received_options));
dhcp_reset_option_seek(dc->rawnet->dhcp_p);
--- 176,198 ----
char *ip_addr_string;
uint8_t *required_options;
! uint8_t received_options[MAX_OPTIONS_HANDLED_NUM];
dhcp_option_t *dhcp_option;
int i;
/* get the mac address, and ip address from the packet. */
ip_addr = ip_get_src_addr(dc->rawnet->ip_p);
eth_addr = eth_get_src_addr(dc->rawnet->ether_p);
! /* find out if we have a list of required options. */
! required_options = client_conf_get_opt_required_bit_array(dc->conf, ip_addr, eth_addr);
+ if(required_options == NULL) {
+ /* if not we ask for our requested options and pick from there. */
+ /* FIXME: it should be configurable that we accept any response. */
+ WARN_MESSAGE("requiring all requested options since no required options have been configured explicity.");
+ required_options = client_conf_get_request_opt_bit_array(dc->conf);
+ }
+
+ /* build our received options array. */
memset(received_options, 0, sizeof(received_options));
dhcp_reset_option_seek(dc->rawnet->dhcp_p);
***************
*** 200,206 ****
received_options[dhcp_option->tag] = 1;
}
-
- /* now ask client-conf if we have the required options. */
- required_options = client_conf_get_opt_required_bit_array(dc->conf, ip_addr, eth_addr);
/* make sure everything in our required option list is in our requested option list. */
--- 208,211 ----
|