• Phil Davis's avatar
    Fix console set interface IP address · 83d40310
    Phil Davis authored
    Problem as per forum https://forum.pfsense.org/index.php?topic=83651.0
    The problem comes whenever services_dhcpd_configure is called - the global $config gets reset from the actual current config, and any pending changes in the current process are lost.
    It was introduced by commit 86ce2df
    in which services_dhcpdv4_configure() does:
    
    require_once('pkg-utils.inc')
    
    and pkg-utils.inc does various stuff like:
    
    if(file_exists("/cf/conf/use_xmlreader"))
    require_once("xmlreader.inc");
    else
    require_once("xmlparse.inc");
    
    which seems to cause a reset of the $config variable, thus losing the pending changes the user has entered at the console.
    
    The top-level code in rc.initial.setlanip really does not need to (and should not) implement any changes along the way - it should collect all the answers from the user, then write_config and then make all the necessary calls to routines to implement the changes on the running system. This fixes it - defer any calls to services_dhcpd_configure() until after all questions are answered and write_config has happened.
    83d40310
Name
Last commit
Last update
..
devd Loading commit data...
inc Loading commit data...
phpshellsessions Loading commit data...
pkg/repos Loading commit data...
bogons Loading commit data...
bogonsv6 Loading commit data...
ca_countries Loading commit data...
config.xml Loading commit data...
ddb.conf Loading commit data...
dh-parameters.1024 Loading commit data...
dh-parameters.2048 Loading commit data...
dh-parameters.4096 Loading commit data...
pubkey.pem Loading commit data...
rc Loading commit data...
rc.backup_dhcpleases.sh Loading commit data...
rc.backup_rrd.sh Loading commit data...
rc.bootup Loading commit data...
rc.carpbackup Loading commit data...
rc.carpmaster Loading commit data...
rc.conf_mount_ro Loading commit data...
rc.conf_mount_rw Loading commit data...
rc.create_full_backup Loading commit data...
rc.disable_hdd_apm Loading commit data...
rc.dumpon Loading commit data...
rc.dyndns.update Loading commit data...
rc.embedded Loading commit data...
rc.expireaccounts Loading commit data...
rc.filter_configure_sync Loading commit data...
rc.filter_configure_xmlrpc Loading commit data...
rc.filter_synchronize Loading commit data...
rc.firmware Loading commit data...
rc.firmware_auto Loading commit data...
rc.halt Loading commit data...
rc.initial Loading commit data...
rc.initial.banner Loading commit data...
rc.initial.defaults Loading commit data...
rc.initial.firmware_update Loading commit data...
rc.initial.halt Loading commit data...
rc.initial.password Loading commit data...
rc.initial.ping Loading commit data...
rc.initial.reboot Loading commit data...
rc.initial.setlanip Loading commit data...
rc.initial.setports Loading commit data...
rc.installer Loading commit data...
rc.interfaces_wan_configure Loading commit data...
rc.kill_states Loading commit data...
rc.linkup Loading commit data...
rc.newipsecdns Loading commit data...
rc.newroutedns Loading commit data...
rc.newwanip Loading commit data...
rc.newwanipv6 Loading commit data...
rc.notify_message Loading commit data...
rc.openvpn Loading commit data...
rc.php_ini_setup Loading commit data...
rc.php_test_run Loading commit data...
rc.prunecaptiveportal Loading commit data...
rc.reboot Loading commit data...
rc.reload_all Loading commit data...
rc.reload_interfaces Loading commit data...
rc.resolv_conf_generate Loading commit data...
rc.restart_webgui Loading commit data...
rc.restore_config_backup Loading commit data...
rc.restore_full_backup Loading commit data...
rc.savecore Loading commit data...
rc.savevoucher Loading commit data...
rc.shutdown Loading commit data...
rc.sshd Loading commit data...
rc.start_packages Loading commit data...
rc.stop_packages Loading commit data...
rc.update_alias_url_data Loading commit data...
rc.update_bogons.sh Loading commit data...
rc.update_urltables Loading commit data...