From 56278e0f8d7a00cfc5b253b19b687ffe8cc69a20 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Mon, 19 Jul 1999 10:18:52 +0000 Subject: [PATCH] cleanup pass over new stuff. --- release/sysinstall/tcpip.c | 19 +++++-------------- usr.sbin/sysinstall/tcpip.c | 19 +++++-------------- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c index 542f20793fc4..8ff9b8cc050e 100644 --- a/release/sysinstall/tcpip.c +++ b/release/sysinstall/tcpip.c @@ -1,5 +1,5 @@ /* - * $Id: tcpip.c,v 1.82 1999/07/18 10:18:06 jkh Exp $ + * $Id: tcpip.c,v 1.83 1999/07/19 10:06:18 jkh Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. @@ -203,7 +203,7 @@ tcpOpenDialog(Device *devp) ComposeObj *obj = NULL; int n = 0, filled = 0, cancel = FALSE; int max, ret = DITEM_SUCCESS; - int use_dhcp = 0; + int use_dhcp = FALSE; char *tmp; char title[80]; @@ -226,19 +226,10 @@ tcpOpenDialog(Device *devp) Mkdir("/tmp"); msgNotify("Scanning for DHCP servers..."); if (!vsystem("dhclient %s", devp->name)) { - if (isDebug()) - msgDebug("Successful return from dhclient"); dhcpGetInfo(devp); use_dhcp = TRUE; } - else { - if (isDebug()) - msgDebug("Unsuccessful return from dhclient"); - use_dhcp = FALSE; - } } - else - use_dhcp = FALSE; /* Get old IP address from variable space, if available */ if (!ipaddr[0]) { @@ -330,7 +321,7 @@ reenter: * the most appropriate one (entire class C, or subnetted * class A/B network). */ - if (netmask[0] == '\0') { + if (!netmask[0]) { strcpy(netmask, "255.255.255.0"); RefreshStringObj(layout[LAYOUT_NETMASK].obj); ++filled; @@ -376,6 +367,8 @@ netconfig: variable_set2(VAR_GATEWAY, gateway, 1); if (nameserver[0]) variable_set2(VAR_NAMESERVER, nameserver, 0); + if (ipaddr[0]) + variable_set2(VAR_IPADDR, ipaddr, 0); if (!devp->private) devp->private = (DevInfo *)safe_malloc(sizeof(DevInfo)); @@ -399,8 +392,6 @@ netconfig: sprintf(ifn, "%s %s", devp->name, ifaces); variable_set2(VAR_INTERFACES, ifn, 1); } - if (ipaddr[0]) - variable_set2(VAR_IPADDR, ipaddr, 0); if (!use_dhcp) configResolv(NULL); /* XXX this will do it on the MFS copy XXX */ ret = DITEM_SUCCESS; diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 542f20793fc4..8ff9b8cc050e 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -1,5 +1,5 @@ /* - * $Id: tcpip.c,v 1.82 1999/07/18 10:18:06 jkh Exp $ + * $Id: tcpip.c,v 1.83 1999/07/19 10:06:18 jkh Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. @@ -203,7 +203,7 @@ tcpOpenDialog(Device *devp) ComposeObj *obj = NULL; int n = 0, filled = 0, cancel = FALSE; int max, ret = DITEM_SUCCESS; - int use_dhcp = 0; + int use_dhcp = FALSE; char *tmp; char title[80]; @@ -226,19 +226,10 @@ tcpOpenDialog(Device *devp) Mkdir("/tmp"); msgNotify("Scanning for DHCP servers..."); if (!vsystem("dhclient %s", devp->name)) { - if (isDebug()) - msgDebug("Successful return from dhclient"); dhcpGetInfo(devp); use_dhcp = TRUE; } - else { - if (isDebug()) - msgDebug("Unsuccessful return from dhclient"); - use_dhcp = FALSE; - } } - else - use_dhcp = FALSE; /* Get old IP address from variable space, if available */ if (!ipaddr[0]) { @@ -330,7 +321,7 @@ reenter: * the most appropriate one (entire class C, or subnetted * class A/B network). */ - if (netmask[0] == '\0') { + if (!netmask[0]) { strcpy(netmask, "255.255.255.0"); RefreshStringObj(layout[LAYOUT_NETMASK].obj); ++filled; @@ -376,6 +367,8 @@ netconfig: variable_set2(VAR_GATEWAY, gateway, 1); if (nameserver[0]) variable_set2(VAR_NAMESERVER, nameserver, 0); + if (ipaddr[0]) + variable_set2(VAR_IPADDR, ipaddr, 0); if (!devp->private) devp->private = (DevInfo *)safe_malloc(sizeof(DevInfo)); @@ -399,8 +392,6 @@ netconfig: sprintf(ifn, "%s %s", devp->name, ifaces); variable_set2(VAR_INTERFACES, ifn, 1); } - if (ipaddr[0]) - variable_set2(VAR_IPADDR, ipaddr, 0); if (!use_dhcp) configResolv(NULL); /* XXX this will do it on the MFS copy XXX */ ret = DITEM_SUCCESS;