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
2016-07-27 19:25:19 +02:00
parent bfe9e011bd
commit 82853bf0ea
+14 -7
View File
@@ -107,16 +107,23 @@ static void networking(void)
/* Bring up all 'auto' interfaces */
while (fgets(buf, sizeof(buf), fp)) {
char *cmd;
char cmd[80];
char *line, *ifname = NULL;
chomp(buf);
cmd = strip_line(buf);
line = strip_line(buf);
if (!strncmp(cmd, "auto", 4)) {
memcpy(cmd, "ifup", 4);
run_interactive(cmd, "Bringing up interface %s", &cmd[5]);
i++;
}
if (!strncmp(line, "auto", 4))
ifname = &line[5];
if (!strncmp(line, "allow-hotplug", 13))
ifname = &line[14];
if (!ifname)
continue;
snprintf(cmd, 80, "/sbin/ifup %s", ifname);
run_interactive(cmd, "Bringing up interface %s", ifname);
i++;
}
fclose(fp);