diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-11-26 12:41:54 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-26 12:41:54 +0900 |
commit | f5c38922666a4b5a2012edb67837238a48c9e4ba (patch) | |
tree | 9c4c2b0ee47121ec3208eba1a8c5a992d6f327b7 /src | |
parent | cfbb1c6def4a1ecce242e8eb6c92ebc5f103adbd (diff) | |
download | systemd-f5c38922666a4b5a2012edb67837238a48c9e4ba.tar.gz |
network: also assume Table=local for ipv6 route if Type=local, broadcast, anycast or nat (#14148)
Also, if Type=multicast and scope is not set, then assume Scope=link.
Fixes #14122.
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-route.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 85df5d9395..592de4e430 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1494,16 +1494,14 @@ int route_section_verify(Route *route, Network *network) { route->section->filename, route->section->line); } - if (route->family != AF_INET6) { - if (!route->table_set && IN_SET(route->type, RTN_LOCAL, RTN_BROADCAST, RTN_ANYCAST, RTN_NAT)) - route->table = RT_TABLE_LOCAL; - - if (!route->scope_set) { - if (IN_SET(route->type, RTN_LOCAL, RTN_NAT)) - route->scope = RT_SCOPE_HOST; - else if (IN_SET(route->type, RTN_BROADCAST, RTN_ANYCAST)) - route->scope = RT_SCOPE_LINK; - } + if (!route->table_set && IN_SET(route->type, RTN_LOCAL, RTN_BROADCAST, RTN_ANYCAST, RTN_NAT)) + route->table = RT_TABLE_LOCAL; + + if (!route->scope_set && route->family != AF_INET6) { + if (IN_SET(route->type, RTN_LOCAL, RTN_NAT)) + route->scope = RT_SCOPE_HOST; + else if (IN_SET(route->type, RTN_BROADCAST, RTN_ANYCAST, RTN_MULTICAST)) + route->scope = RT_SCOPE_LINK; } if (network->n_static_addresses == 0 && |