networkd: use RT_TABLE_MAIN by default

The default route table used by sd-netlink (and iproute2) is
RT_TABLE_MAIN, not RT_TABLE_DEFAULT. Ensure networkd has the same idea.
This commit is contained in:
Michael Chapman
2016-08-18 17:54:12 +10:00
parent 3bdccf69ca
commit a0d95bbc38
+2 -4
View File
@@ -41,7 +41,7 @@ int route_new(Route **ret) {
route->family = AF_UNSPEC;
route->scope = RT_SCOPE_UNIVERSE;
route->protocol = RTPROT_UNSPEC;
route->table = RT_TABLE_DEFAULT;
route->table = RT_TABLE_MAIN;
route->lifetime = USEC_INFINITY;
*ret = route;
@@ -549,14 +549,12 @@ int route_configure(
if (r < 0)
return log_error_errno(r, "Could not set flags: %m");
if (route->table != RT_TABLE_DEFAULT) {
if (route->table != RT_TABLE_MAIN) {
if (route->table < 256) {
r = sd_rtnl_message_route_set_table(req, route->table);
if (r < 0)
return log_error_errno(r, "Could not set route table: %m");
} else {
r = sd_rtnl_message_route_set_table(req, RT_TABLE_UNSPEC);
if (r < 0)
return log_error_errno(r, "Could not set route table: %m");