From: Lennart Poettering Date: Tue, 23 Jul 2019 12:28:41 +0000 (+0200) Subject: local-addresses: filter out any routing tables but the main one X-Git-Tag: v243-rc1~53^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1b014df9e70c7bc53b7ff48d576bc99cf843d13;p=thirdparty%2Fsystemd.git local-addresses: filter out any routing tables but the main one Fixes: #13132 --- diff --git a/src/shared/local-addresses.c b/src/shared/local-addresses.c index 751144539bc..2f3d6756432 100644 --- a/src/shared/local-addresses.c +++ b/src/shared/local-addresses.c @@ -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;