[Dhcp-agent-commits] dhcp-agent dhcp-agent.h,1.64,1.65 dhcp-client-conf.c,1.15,1.16 dhcp-sysconf.c,1
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2002-07-04 14:02:56
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv8293 Modified Files: dhcp-agent.h dhcp-client-conf.c dhcp-sysconf.c Log Message: added mtu to interface setting Index: dhcp-agent.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-agent.h,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** dhcp-agent.h 2 Jul 2002 18:46:21 -0000 1.64 --- dhcp-agent.h 4 Jul 2002 14:02:53 -0000 1.65 *************** *** 411,414 **** --- 411,415 ---- # define TAG_DHCP_SUBNET_MASK 1 # define TAG_DHCP_HOSTNAME 12 + # define TAG_DHCP_INTERFACE_MTU 26 # define TAG_DHCP_REQUEST_IP_ADDRESS 50 # define TAG_DHCP_OPTION_OVERLOAD 52 Index: dhcp-client-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client-conf.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dhcp-client-conf.c 3 Jul 2002 01:24:20 -0000 1.15 --- dhcp-client-conf.c 4 Jul 2002 14:02:53 -0000 1.16 *************** *** 29,32 **** --- 29,34 ---- #include <dhcp-varfile.h> + #define DEFAULT_CONFIG_OPTIONS_LEN 8 + /* Basic network configuration. * Here we keep the options we want by default. */ *************** *** 36,39 **** --- 38,42 ---- 3, /* Routers. */ 6, /* Domain Name Servers. */ + 26, /* Interface MTU */ 15, /* Domain Name. */ 50, /* IP Address lease time. */ *************** *** 42,48 **** }; - - static const int default_config_options_len = 7; - static void client_conf_reset_options(client_conf_t *cc) { --- 45,48 ---- *************** *** 87,91 **** return -1; ! for(i = 0;i < default_config_options_len; i++) { if(fprintf(fp, "\"%s\"\n",dhcp_options_strings[default_config_options[i]]) < 0) { --- 87,91 ---- return -1; ! for(i = 0;i < DEFAULT_CONFIG_OPTIONS_LEN; i++) { if(fprintf(fp, "\"%s\"\n",dhcp_options_strings[default_config_options[i]]) < 0) { *************** *** 104,108 **** int i; ! for(i = 0;i < default_config_options_len; i++) { cc->options[default_config_options[i]] = 1; } --- 104,108 ---- int i; ! for(i = 0;i < DEFAULT_CONFIG_OPTIONS_LEN; i++) { cc->options[default_config_options[i]] = 1; } Index: dhcp-sysconf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-sysconf.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** dhcp-sysconf.c 2 Jul 2002 18:41:40 -0000 1.26 --- dhcp-sysconf.c 4 Jul 2002 14:02:53 -0000 1.27 *************** *** 297,303 **** list_t *list_ptr; uint32_t addr, netmask; ! unsigned char have_addr = 0; ! unsigned char have_netmask = 0; ! int mtu = DEFAULT_MTU; cache_entry_t *ce; void *data; --- 297,303 ---- list_t *list_ptr; uint32_t addr, netmask; ! uint8_t have_addr = 0; ! uint8_t have_netmask = 0; ! uint16_t mtu = DEFAULT_MTU; cache_entry_t *ce; void *data; *************** *** 316,322 **** xfree(data); have_addr = 1; - - if(have_addr && have_netmask) /* if we're done finding both, break out. */ - break; continue; --- 316,319 ---- *************** *** 331,336 **** have_netmask = 1; ! if(have_addr && have_netmask) /* if we're done finding both, break out. */ ! break; continue; --- 328,340 ---- have_netmask = 1; ! continue; ! } ! ! if(string_matches(dhcp_options_strings[TAG_DHCP_INTERFACE_MTU], ! ce->name)) { ! ! data = option_convert_handlers[TAG_DHCP_INTERFACE_MTU].serialize_to_internal(ce->value); ! memcpy(&mtu, data, sizeof(uint16_t)); ! xfree(data); continue; *************** *** 344,348 **** } ! if(rawnet_interface_up(dc->rawnet, addr, netmask, mtu)) { push_exception("sysconf", "sysconf_setup_interface", "could not bring interface up: %s", rawnet_get_device_name(dc->rawnet)); --- 348,352 ---- } ! if(rawnet_interface_up(dc->rawnet, addr, netmask, (int)mtu)) { push_exception("sysconf", "sysconf_setup_interface", "could not bring interface up: %s", rawnet_get_device_name(dc->rawnet)); |