]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: allow 0 for table number
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Oct 2022 02:33:19 +0000 (11:33 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Oct 2022 02:33:22 +0000 (11:33 +0900)
Fixes #25089.

src/network/networkd-route-util.c

index 312f5f298a53acdbdf390ae141ae1488f7e68b5f..036638209311f6376365e4be9c159ccf047d709a 100644 (file)
@@ -417,8 +417,8 @@ int manager_get_route_table_to_string(const Manager *m, uint32_t table, char **r
         assert(m);
         assert(ret);
 
-        if (table == 0)
-                return -EINVAL;
+        /* Unlike manager_get_route_table_from_string(), this accepts 0, as the kernel may create routes with
+         * table 0. See issue #25089. */
 
         s = route_table_to_string(table);
         if (!s)