mirror of
https://github.com/systemd/systemd.git
synced 2025-01-12 13:18:14 +03:00
Merge pull request #13145 from poettering/nss-gateway-fix
filter _gateway NSS resolving to only use main routing table
This commit is contained in:
commit
181824e32c
@ -1540,6 +1540,7 @@ foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'],
|
||||
'-shared',
|
||||
'-Wl,--version-script=' + version_script_arg],
|
||||
link_with : [libsystemd_static,
|
||||
libshared_static,
|
||||
libbasic],
|
||||
dependencies : [threads,
|
||||
librt],
|
||||
|
@ -71,8 +71,6 @@ libsystemd_sources = files('''
|
||||
sd-hwdb/hwdb-util.h
|
||||
sd-hwdb/sd-hwdb.c
|
||||
sd-netlink/generic-netlink.c
|
||||
sd-netlink/local-addresses.c
|
||||
sd-netlink/local-addresses.h
|
||||
sd-netlink/netlink-internal.h
|
||||
sd-netlink/netlink-message.c
|
||||
sd-netlink/netlink-slot.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;
|
@ -109,6 +109,8 @@ shared_sources = files('''
|
||||
linux/bpf_insn.h
|
||||
linux/dm-ioctl.h
|
||||
linux/ethtool.h
|
||||
local-addresses.c
|
||||
local-addresses.h
|
||||
lockfile-util.c
|
||||
lockfile-util.h
|
||||
log-link.h
|
||||
@ -170,8 +172,8 @@ shared_sources = files('''
|
||||
udev-util.h
|
||||
uid-range.c
|
||||
uid-range.h
|
||||
unit-file.h
|
||||
unit-file.c
|
||||
unit-file.h
|
||||
utmp-wtmp.h
|
||||
varlink.c
|
||||
varlink.h
|
||||
|
@ -754,6 +754,10 @@ tests += [
|
||||
[['src/test/test-sd-hwdb.c'],
|
||||
[],
|
||||
[]],
|
||||
|
||||
[['src/test/test-local-addresses.c'],
|
||||
[],
|
||||
[]],
|
||||
]
|
||||
|
||||
############################################################
|
||||
@ -964,10 +968,6 @@ tests += [
|
||||
[],
|
||||
[]],
|
||||
|
||||
[['src/libsystemd/sd-netlink/test-local-addresses.c'],
|
||||
[],
|
||||
[]],
|
||||
|
||||
[['src/libsystemd/sd-resolve/test-resolve.c'],
|
||||
[],
|
||||
[threads],
|
||||
|
Loading…
Reference in New Issue
Block a user