summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-02-24 11:24:08 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-02-25 11:01:50 +0900
commitd3aff22f197c6aeca55a8acd1047f8ce3bbd2c6e (patch)
treeb3c205d6f0d61cd6b98f613c8ff4ddebdddb76da /src
parenta79a8d16d5b5f8709361d8deb42fc84ff2fe9c30 (diff)
downloadsystemd-d3aff22f197c6aeca55a8acd1047f8ce3bbd2c6e.tar.gz
network: address: drop unnecessary call of address_get()
As here `req->address` and the result `existing` are always equivalent.
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-address.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index bcb23c90e1..4369d09fa0 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -1270,30 +1270,24 @@ static bool address_is_ready_to_configure(Link *link, const Address *address) {
}
int request_process_address(Request *req) {
- Address *existing;
+ Address *address;
Link *link;
int r;
assert(req);
- assert(req->link);
- assert(req->address);
assert(req->type == REQUEST_TYPE_ADDRESS);
- link = req->link;
+ address = ASSERT_PTR(req->address);
+ link = ASSERT_PTR(req->link);
- r = address_get(link, req->address, &existing);
- if (r < 0)
- return log_link_warning_errno(link, r, "Failed to get address: %m");
-
- if (!address_is_ready_to_configure(link, existing))
+ if (!address_is_ready_to_configure(link, address))
return 0;
- r = address_configure(req->address, link, req->netlink_handler);
+ r = address_configure(address, link, req->netlink_handler);
if (r < 0)
return log_link_warning_errno(link, r, "Failed to configure address: %m");
- address_enter_configuring(existing);
-
+ address_enter_configuring(address);
return 1;
}