]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: refuse IPv4 multipath route for IPv6 route
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 4 Feb 2021 15:49:49 +0000 (00:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 17 Feb 2021 13:08:15 +0000 (22:08 +0900)
src/network/networkd-route.c

index 474f8a8861d6ef59d7c22aa33fa35179b0281bd8..fca6c032db791c40c50a511308f5a937161fe0ef 100644 (file)
@@ -2573,6 +2573,17 @@ static int route_section_verify(Route *route, Network *network) {
                 route->gateway_onlink = true;
         }
 
+        if (route->family == AF_INET6) {
+                MultipathRoute *m;
+
+                ORDERED_SET_FOREACH(m, route->multipath_routes)
+                        if (m->gateway.family == AF_INET)
+                                return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
+                                                         "%s: IPv4 multipath route is specified for IPv6 route. "
+                                                         "Ignoring [Route] section from line %u.",
+                                                         route->section->filename, route->section->line);
+        }
+
         return 0;
 }