summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2006-02-09 14:43:42 +0000
committerdelphij <delphij@FreeBSD.org>2006-02-09 14:43:42 +0000
commitcc0235b2468a7f4e32538597e930894fac9abd33 (patch)
tree8d89099914d0a01ca5272afb127feb88a221f97e /usr.sbin
parent1da629db3a429ed0923f6c1381130d7dffc0f3ac (diff)
downloadFreeBSD-src-cc0235b2468a7f4e32538597e930894fac9abd33.zip
FreeBSD-src-cc0235b2468a7f4e32538597e930894fac9abd33.tar.gz
Actually fix the DHCP handling, by using more robust detection of DHCP
setting. While there, add some more debug messages explaining what is happening, and some comments to improve readability. Submitted by: ceri
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sysinstall/network.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c
index a03f69b..20a0430 100644
--- a/usr.sbin/sysinstall/network.c
+++ b/usr.sbin/sysinstall/network.c
@@ -126,8 +126,12 @@ mediaInitNetwork(Device *dev)
snprintf(ifconfig, 255, "%s%s", VAR_IFCONFIG, dev->name);
cp = variable_get(ifconfig);
if (cp) {
- if (strcmp(cp, "DHCP")) {
- msgDebug("ifconfig %s %s\n", dev->name, cp);
+ /*
+ * If this interface isn't a DHCP one, bring it up.
+ * If it is, then it's already up.
+ */
+ if (strstr(cp, "DHCP") == NULL) {
+ msgDebug("Not a DHCP interface.\n");
i = vsystem("ifconfig %s %s", dev->name, cp);
if (i) {
msgConfirm("Unable to configure the %s interface!\n"
@@ -144,6 +148,8 @@ mediaInitNetwork(Device *dev)
msgDebug("Adding default route to %s.\n", rp);
vsystem("route -n add default %s", rp);
}
+ } else {
+ msgDebug("A DHCP interface. Should already be up.\n");
}
} else if ((cp = variable_get(VAR_IPV6ADDR)) == NULL || *cp == '\0') {
msgConfirm("The %s device is not configured. You will need to do so\n"
OpenPOWER on IntegriCloud