mirror of
https://github.com/systemd/systemd.git
synced 2024-12-25 01:34:28 +03:00
local-addresses: filter out any routing tables but the main one
Fixes: #13132
This commit is contained in:
parent
733cbd00b0
commit
d1b014df9e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user