summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-12-08 13:58:48 +0100
committerTom Gundersen <teg@jklm.no>2014-12-08 18:38:55 +0100
commit935c0d26f7ca748e78a02f524908ede696dc4cda (patch)
tree7a55e6fcef13fa7c9a48e4dca4af648aa694ea02 /src/network
parentca6038b89645c0c1bd547d6a420bf95eb3d6f4cc (diff)
networkd: route - ignore unknown address family
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-route.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index 4e389db5ef..590dd49df9 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -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;