← Commit list

e5aba8871

Nicolas Cavallari
Nicolas Cavallari
2016-03-01
SUCCESS Duration: 255s

Subject

ifupdown: allow duplicate interface definitions

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/ifupdown.c+14 -1
@@ -875,7 +875,19 @@ static struct interfaces_file_t *read_interfaces(const char *filename, struct in
currif->method = get_method(currif->address_family, method_name);
if (!currif->method)
bb_error_msg_and_die("unknown method \"%s\"", method_name);
-
+#if 0
+// Allegedly, Debian allows a duplicate definition:
+// iface eth0 inet static
+// address 192.168.0.15
+// netmask 255.255.0.0
+// gateway 192.168.0.1
+//
+// iface eth0 inet static
+// address 10.0.0.1
+// netmask 255.255.255.0
+//
+// This adds *two* addresses to eth0 (probably requires use of "ip", not "ifconfig"
+//
for (iface_list = defn->ifaces; iface_list; iface_list = iface_list->link) {
struct interface_defn_t *tmp = (struct interface_defn_t *) iface_list->data;
if ((strcmp(tmp->iface, currif->iface) == 0)
@@ -884,6 +896,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename, struct in
bb_error_msg_and_die("duplicate interface \"%s\"", tmp->iface);
}
}
+#endif
llist_add_to_end(&(defn->ifaces), (char*)currif);
debug_noise("iface %s %s %s\n", currif->iface, address_family_name, method_name);