Module Name:    src
Committed By:   riz
Date:           Tue May  1 18:28:47 UTC 2012

Modified Files:
        src/distrib/utils/sysinst: net.c

Log Message:
Check for del_rc_conf() == 0, not !del_rc_conf(), and fix a couple of
instances where the check was wrong.  sysinst now properly saves dhcp
and host config again.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/distrib/utils/sysinst/net.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/sysinst/net.c
diff -u src/distrib/utils/sysinst/net.c:1.131 src/distrib/utils/sysinst/net.c:1.132
--- src/distrib/utils/sysinst/net.c:1.131	Fri Apr  6 23:48:54 2012
+++ src/distrib/utils/sysinst/net.c	Tue May  1 18:28:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.131 2012/04/06 23:48:54 riz Exp $	*/
+/*	$NetBSD: net.c,v 1.132 2012/05/01 18:28:47 riz Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1161,8 +1161,8 @@ mnt_net_config(void)
 		return;
 
 	/* Write hostname to /etc/rc.conf */
-	if ((net_dhcpconf & DHCPCONF_HOST) == 0)
-		if (del_rc_conf("hostname"))
+	if ((net_dhcpconf & DHCPCONF_HOST) == 0) 
+		if (del_rc_conf("hostname") == 0)
 			add_rc_conf("hostname=%s\n", recombine_host_domain());
 
 	/* Copy resolv.conf to target.  If DHCP was used to create it,
@@ -1227,17 +1227,19 @@ mnt_net_config(void)
 			fclose(hosts);
 		}
 
-		if (!del_rc_conf("defaultroute"))
+		if (del_rc_conf("defaultroute") == 0)
 			add_rc_conf("defaultroute=\"%s\"\n", net_defroute);
 	} else {
-		if (snprintf(ifconfig_str, sizeof ifconfig_str, "ifconfig_%s", net_dev) > 0
-				&& del_rc_conf(ifconfig_str))
+		if (snprintf(ifconfig_str, sizeof ifconfig_str,
+		    "ifconfig_%s", net_dev) > 0 &&
+		    del_rc_conf(ifconfig_str) == 0) {
 			add_rc_conf("ifconfig_%s=dhcp\n", net_dev);
+		}
         }
 
 #ifdef INET6
 	if ((net_ip6conf & IP6CONF_AUTOHOST) != 0) {
-		if (!del_rc_conf("ip6mode"))
+		if (del_rc_conf("ip6mode") == 0)
 			add_rc_conf("ip6mode=autohost\n");
 		if (ifconf != NULL) {
 			scripting_fprintf(NULL, "cat <<EOF >>%s%s\n",

Reply via email to