Follow-up to collapse and simplify code
@@ -152,12 +152,13 @@ static void networking(void)
/* Run user network start script if enabled */
if (network) {
run_interactive(network, "Starting networking: %s", network);
- return;
+ goto done;
}
/* Debian/Ubuntu/Busybox/RH/Suse */
- if (fexist("/sbin/ifup")) {
- /* interfaces file */
+ if (!fexist("/sbin/ifup"))
+ goto done;
+
fp = fopen("/etc/network/interfaces", "r");
if (fp) {
int i = 0;
@@ -185,11 +186,9 @@ static void networking(void)
}
fclose(fp);
- if (i)
- return;
- }
}
+done:
/* Fall back to bring up at least loopback */
ifconfig("lo", "127.0.0.1", "255.0.0.0", 1);
}
