network: use VRF's route table if VRF= is set

Fixes #14940.
This commit is contained in:
Yu Watanabe 2020-02-26 15:42:32 +09:00
parent 1ad448673e
commit c0d48bc50f
1 changed files with 6 additions and 1 deletions

View File

@ -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;