]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
local-addresses: filter out any routing tables but the main one
authorLennart Poettering <lennart@poettering.net>
Tue, 23 Jul 2019 12:28:41 +0000 (14:28 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Jul 2019 07:07:30 +0000 (09:07 +0200)
Fixes: #13132
src/shared/local-addresses.c

index 751144539bcc07ed3175179227290d9b116b9f49..2f3d6756432f7a0ceb619666eae5019b98407db7 100644 (file)
@@ -175,7 +175,7 @@ int local_gateways(sd_netlink *context, int ifindex, int af, struct local_addres
         for (m = reply; m; m = sd_netlink_message_next(m)) {
                 struct local_address *a;
                 uint16_t type;
-                unsigned char dst_len, src_len;
+                unsigned char dst_len, src_len, table;
                 uint32_t ifi;
                 int family;
 
@@ -202,6 +202,12 @@ int local_gateways(sd_netlink *context, int ifindex, int af, struct local_addres
                 if (src_len != 0)
                         continue;
 
+                r = sd_rtnl_message_route_get_table(m, &table);
+                if (r < 0)
+                        return r;
+                if (table != RT_TABLE_MAIN)
+                        continue;
+
                 r = sd_netlink_message_read_u32(m, RTA_OIF, &ifi);
                 if (r == -ENODATA) /* Not all routes have an RTA_OIF attribute (for example nexthop ones) */
                         continue;