]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: use RT_TABLE_MAIN by default 3990/head
authorMichael Chapman <mike@very.puzzling.org>
Thu, 18 Aug 2016 07:54:12 +0000 (17:54 +1000)
committerMichael Chapman <mike@very.puzzling.org>
Thu, 18 Aug 2016 07:54:12 +0000 (17:54 +1000)
The default route table used by sd-netlink (and iproute2) is
RT_TABLE_MAIN, not RT_TABLE_DEFAULT. Ensure networkd has the same idea.

src/network/networkd-route.c

index 5335df53c7e976405ca7bb3f4a57ca552c4b0343..b197a5da6b390ac7f54220eae4790fafbed1991e 100644 (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");