chiark / gitweb /
networkd: fix several Address entries in [Network] section
authorTom Gundersen <teg@jklm.no>
Thu, 28 Nov 2013 16:17:04 +0000 (17:17 +0100)
committerTom Gundersen <teg@jklm.no>
Thu, 28 Nov 2013 16:17:04 +0000 (17:17 +0100)
src/network/networkd-address.c
src/network/networkd-route.c

index 0555d31..8f16a8c 100644 (file)
@@ -155,6 +155,12 @@ int config_parse_address(const char *unit,
         assert(rvalue);
         assert(data);
 
+        if (streq(section, "Network")) {
+                /* we are not in an Address section, so treat
+                 * this as the special '0' section */
+                section_line = 0;
+        }
+
         r = address_new(network, section_line, &n);
         if (r < 0)
                 return r;
index 1166a99..1ea6237 100644 (file)
@@ -142,6 +142,12 @@ int config_parse_gateway(const char *unit,
         assert(rvalue);
         assert(data);
 
+        if (streq(section, "Network")) {
+                /* we are not in an Route section, so treat
+                 * this as the special '0' section */
+                section_line = 0;
+        }
+
         r = route_new(network, section_line, &n);
         if (r < 0)
                 return r;