From ebfcfa9218d28273c88ec434c7b2f8aef859c13b Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Mon, 28 Dec 2009 21:51:17 +0100 Subject: [PATCH] installer: Fix the manual configuration of lnc(4) in VMware. 7daaee58e8b828a4951bb466c19b066381826d2c fixed the DHCP case but not the manual configuration case. Apply a similar fix there. While here, move the DHCP fix a bit up, just to look similar in both cases. However, the exact issue hasn't been found yet. We don't know why string is junk in VMware before these fixes, as nothing before the old location of the asprintf() seems to modify it. In-discussion-with: matthias --- usr.sbin/installer/dfuibe_installer/fn_configure.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/usr.sbin/installer/dfuibe_installer/fn_configure.c b/usr.sbin/installer/dfuibe_installer/fn_configure.c index 028e3467b6..dc4fde367b 100644 --- a/usr.sbin/installer/dfuibe_installer/fn_configure.c +++ b/usr.sbin/installer/dfuibe_installer/fn_configure.c @@ -967,6 +967,8 @@ fn_assign_ip(struct i_fn_args *a) "an IP address from a nearby DHCP server.\n\n" "Would you like to enable DHCP for %s?"), interface)) { case 1: + asprintf(&string, "ifconfig_%s", interface); + cmds = commands_new(); cmd = command_add(cmds, "%s%s dhclient", a->os_root, cmd_name(a, "KILLALL")); @@ -974,7 +976,6 @@ fn_assign_ip(struct i_fn_args *a) command_add(cmds, "%s%s %s", a->os_root, cmd_name(a, "DHCLIENT"), interface); - asprintf(&string, "ifconfig_%s", interface); if (commands_execute(a, cmds)) { /* XXX sleep(3); */ show_ifconfig(a->c, interface); @@ -1052,6 +1053,10 @@ fn_assign_ip(struct i_fn_args *a) hostname = dfui_dataset_get_value(new_ds, "hostname"); domain = dfui_dataset_get_value(new_ds, "domain"); + asprintf(&string, "ifconfig_%s", interface); + asprintf(&string1, "inet %s netmask %s", + interface_ip, interface_netmask); + cmds = commands_new(); command_add(cmds, "%s%s %s %s netmask %s", a->os_root, cmd_name(a, "IFCONFIG"), @@ -1084,10 +1089,6 @@ fn_assign_ip(struct i_fn_args *a) } commands_free(cmds); - asprintf(&string, "ifconfig_%s", interface); - asprintf(&string1, "inet %s netmask %s", - interface_ip, interface_netmask); - config_var_set(rc_conf, string, string1); config_var_set(rc_conf, "defaultrouter", defaultrouter); -- 2.41.0