From 6262c79b70d81b64bca776b77a91aa0aca1e916e Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Fri, 15 May 2009 00:18:31 +0000 Subject: [PATCH] Allow a comma-separated list of network interfaces to be specified via the netDev option in install.cfg. Submitted by: randi MFC after: 1 week --- usr.sbin/sysinstall/tcpip.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 18849fcb1c1..f505a0581c0 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -642,11 +642,26 @@ tcpDeviceSelect(void) { DMenu *menu; Device **devs, *rval; + char *dev, *network_dev; int cnt; + rval = NULL; + + if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETWORK_DEVICE)) { + network_dev = variable_get(VAR_NETWORK_DEVICE); + + while ((dev = strsep(&network_dev, ",")) != NULL) { + devs = deviceFind(dev, DEVICE_TYPE_NETWORK); + cnt = deviceCount(devs); + if (cnt) { + if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS)) + return(devs[0]); + } + } + } + devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK); cnt = deviceCount(devs); - rval = NULL; if (!cnt) { msgConfirm("No network devices available!"); @@ -660,14 +675,6 @@ tcpDeviceSelect(void) if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS)) rval = devs[0]; } - else if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETWORK_DEVICE)) { - devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK); - cnt = deviceCount(devs); - if (cnt) { - if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS)) - rval = devs[0]; - } - } else { int status; -- 2.45.2