[dhcp-agent-commits] dhcp-agent/src dhcp-client-states.c,1.44,1.45
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2003-08-28 15:41:59
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv23351 Modified Files: dhcp-client-states.c Log Message: minor optimization when checking dhcp type. we're not longer walking through the options everytime where we can avoid it Index: dhcp-client-states.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-states.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** dhcp-client-states.c 28 Jun 2003 17:50:06 -0000 1.44 --- dhcp-client-states.c 28 Aug 2003 15:41:54 -0000 1.45 *************** *** 549,557 **** static int client_check_request(void *arg) { dhcp_client_control_t *dc = arg; if(client_check_dhcp(dc) && ! (dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPACK_TM) || ! dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPNAK_TM))) return 1; else --- 549,560 ---- static int client_check_request(void *arg) { + int dhcp_type; dhcp_client_control_t *dc = arg; + dhcp_type = dhcp_get_type(dc->rawnet->dhcp_p); + if(client_check_dhcp(dc) && ! (dhcp_type == DHCP_DHCPACK_TM || ! dhcp_type == DHCP_DHCPACK_TM)) return 1; else *************** *** 860,864 **** return STATE_BOUND; ! } else if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPNAK_TM)) { /* we've been told our lease is no good. */ --- 863,867 ---- return STATE_BOUND; ! } else { /* we've been told our lease is no good. */ *************** *** 872,880 **** return STATE_INIT; - } else { - - ERROR_MESSAGE("received neither NACK nor ACK -- this should never happen because of higher filters."); - FATAL_MESSAGE("I shouldn't be here. this is a bug report me."); - exit(1); /* get rid of compiler warning. */ } } --- 875,878 ---- *************** *** 932,936 **** return STATE_BOUND; ! } else if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPNAK_TM)) { /* we've been told our lease is no good. */ --- 930,934 ---- return STATE_BOUND; ! } else { /* we've been told our lease is no good. */ *************** *** 944,952 **** return STATE_INIT; - } else { - - ERROR_MESSAGE("received neither NACK nor ACK -- this should never happen because of higher filters."); - FATAL_MESSAGE("I shouldn't be here. this is a bug report me."); - exit(1); /* get rid of compiler warning. */ } } --- 942,945 ---- |