From: Yu Watanabe Date: Wed, 26 Feb 2020 06:42:32 +0000 (+0900) Subject: network: use VRF's route table if VRF= is set X-Git-Tag: v245-rc2~51^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0d48bc50ff45b424f900b7c738a920739e33a3b;p=thirdparty%2Fsystemd.git network: use VRF's route table if VRF= is set Fixes #14940. --- diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index e924723e5d9..de532eee7aa 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -17,7 +17,7 @@ #include "string-util.h" #include "strxcpyx.h" #include "sysctl-util.h" -#include "util.h" +#include "vrf.h" #define ROUTES_DEFAULT_MAX_PER_FAMILY 4096U @@ -1700,6 +1700,11 @@ int route_section_verify(Route *route, Network *network) { route->section->filename, route->section->line); } + if (!route->table_set && network->vrf) { + route->table = VRF(network->vrf)->table; + route->table_set = true; + } + if (!route->table_set && IN_SET(route->type, RTN_LOCAL, RTN_BROADCAST, RTN_ANYCAST, RTN_NAT)) route->table = RT_TABLE_LOCAL;