1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 23:21:22 +03:00

sd-netlink: do not enable dump flag by default for RTM_GETADDR message

This commit is contained in:
Yu Watanabe 2021-05-24 22:47:01 +09:00
parent 97bb863c25
commit f318f64388
4 changed files with 10 additions and 5 deletions

View File

@ -664,9 +664,6 @@ int sd_rtnl_message_new_addr(sd_netlink *rtnl, sd_netlink_message **ret,
if (r < 0)
return r;
if (nlmsg_type == RTM_GETADDR)
(*ret)->hdr->nlmsg_flags |= NLM_F_DUMP;
ifa = NLMSG_DATA((*ret)->hdr);
ifa->ifa_index = index;

View File

@ -114,7 +114,7 @@ static void test_address_get(sd_netlink *rtnl, int ifindex) {
assert_se(sd_rtnl_message_new_addr(rtnl, &m, RTM_GETADDR, ifindex, AF_INET) >= 0);
assert_se(m);
assert_se(sd_netlink_message_request_dump(m, true) >= 0);
assert_se(sd_netlink_call(rtnl, m, -1, &r) == 1);
assert_se(sd_netlink_message_read_in_addr(r, IFA_LOCAL, &in_data) == 0);
@ -479,7 +479,7 @@ static void test_get_addresses(sd_netlink *rtnl) {
sd_netlink_message *m;
assert_se(sd_rtnl_message_new_addr(rtnl, &req, RTM_GETADDR, 0, AF_UNSPEC) >= 0);
assert_se(sd_netlink_message_request_dump(req, true) >= 0);
assert_se(sd_netlink_call(rtnl, req, 0, &reply) >= 0);
for (m = reply; m; m = sd_netlink_message_next(m)) {

View File

@ -759,6 +759,10 @@ static int link_enumerate_ipv6_tentative_addresses(Link *link) {
if (r < 0)
return r;
r = sd_netlink_message_request_dump(req, true);
if (r < 0)
return r;
r = sd_netlink_call(link->manager->rtnl, req, 0, &reply);
if (r < 0)
return r;

View File

@ -83,6 +83,10 @@ int local_addresses(
if (r < 0)
return r;
r = sd_netlink_message_request_dump(req, true);
if (r < 0)
return r;
r = sd_netlink_call(rtnl, req, 0, &reply);
if (r < 0)
return r;