Add support for ifupdown 'allow-hotplug' keyword

Look for 'auto' *and* 'allow-hotplug' in /etc/network/interfaces when
bringing up Debian/BusyBox interfaces at boot.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-07-27 19:25:19 +02:00
1 parent bfe9e011bd
commit 82853bf0ea
1 file changed
+14 -7
+14 -7
View File
@@ -107,16 +107,23 @@ static void networking(void)
/* Bring up all 'auto' interfaces */ /* Bring up all 'auto' interfaces */
while (fgets(buf, sizeof(buf), fp)) { while (fgets(buf, sizeof(buf), fp)) {
char *cmd; char cmd[80];
char *line, *ifname = NULL;
chomp(buf); chomp(buf);
cmd = strip_line(buf); line = strip_line(buf);
if (!strncmp(cmd, "auto", 4)) { if (!strncmp(line, "auto", 4))
memcpy(cmd, "ifup", 4); ifname = &line[5];
run_interactive(cmd, "Bringing up interface %s", &cmd[5]); if (!strncmp(line, "allow-hotplug", 13))
i++; ifname = &line[14];
}
if (!ifname)
continue;
snprintf(cmd, 80, "/sbin/ifup %s", ifname);
run_interactive(cmd, "Bringing up interface %s", ifname);
i++;
} }
fclose(fp); fclose(fp);