diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-24 03:24:08 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-25 03:01:50 +0100 |
commit | d3aff22f197c6aeca55a8acd1047f8ce3bbd2c6e (patch) | |
tree | b3c205d6f0d61cd6b98f613c8ff4ddebdddb76da /src | |
parent | network: drop detailed log messages (diff) | |
download | systemd-d3aff22f197c6aeca55a8acd1047f8ce3bbd2c6e.tar.xz systemd-d3aff22f197c6aeca55a8acd1047f8ce3bbd2c6e.zip |
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.c | 18 |
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; } |