installer: Fix the manual configuration of lnc(4) in VMware.
authorSascha Wildner <saw@online.de>
Mon, 28 Dec 2009 20:51:17 +0000 (21:51 +0100)
committerSascha Wildner <saw@online.de>
Mon, 28 Dec 2009 20:51:37 +0000 (21:51 +0100)
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

index 028e346..dc4fde3 100644 (file)
@@ -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);