chiark / gitweb /
networkd: route - ignore unknown address family
authorTom Gundersen <teg@jklm.no>
Mon, 8 Dec 2014 12:58:48 +0000 (13:58 +0100)
committerTom Gundersen <teg@jklm.no>
Mon, 8 Dec 2014 17:38:55 +0000 (18:38 +0100)
src/network/networkd-route.c

index 4e389db..590dd49 100644 (file)
@@ -353,6 +353,12 @@ int config_parse_destination(const char *unit,
                 return 0;
         }
 
+        if (f != AF_INET && f != AF_INET6) {
+                log_syntax(unit, LOG_ERR, filename, line, EINVAL,
+                           "Unknown address family, ignoring assignment: %s", address);
+                return 0;
+        }
+
         /* prefixlen */
         if (e) {
                 r = safe_atou8(e + 1, &prefixlen);
@@ -362,7 +368,7 @@ int config_parse_destination(const char *unit,
                         return 0;
                 }
         } else {
-                switch (n->family) {
+                switch (f) {
                         case AF_INET:
                                 prefixlen = 32;
                                 break;