summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 1f5f4bd41a..ab4f321b00 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1026,8 +1026,7 @@ static Link *link_drop(Link *link) {
hashmap_remove(link->manager->links_by_name, link->ifname);
/* bonding master and its slaves have the same hardware address. */
- if (hashmap_get(link->manager->links_by_hw_addr, &link->hw_addr) == link)
- hashmap_remove(link->manager->links_by_hw_addr, &link->hw_addr);
+ hashmap_remove_value(link->manager->links_by_hw_addr, &link->hw_addr, link);
/* The following must be called at last. */
assert_se(hashmap_remove(link->manager->links_by_index, INT_TO_PTR(link->ifindex)) == link);
@@ -1775,7 +1774,7 @@ static int link_admin_state_up(Link *link) {
return 0;
if (link->activated && link->network->activation_policy == ACTIVATION_POLICY_ALWAYS_DOWN) {
- log_link_info(link, "ActivationPolicy is \"always-off\", forcing link down.");
+ log_link_info(link, "Activation policy is \"always-down\", forcing link down.");
return link_request_to_bring_up_or_down(link, /* up = */ false);
}
@@ -1795,7 +1794,7 @@ static int link_admin_state_down(Link *link) {
return 0;
if (link->activated && link->network->activation_policy == ACTIVATION_POLICY_ALWAYS_UP) {
- log_link_info(link, "ActivationPolicy is \"always-on\", forcing link up.");
+ log_link_info(link, "Activation policy is \"always-up\", forcing link up.");
return link_request_to_bring_up_or_down(link, /* up = */ true);
}
@@ -2148,8 +2147,7 @@ static int link_update_hardware_address(Link *link, sd_netlink_message *message)
log_link_debug(link, "Hardware address is changed: %s → %s",
HW_ADDR_TO_STR(&link->hw_addr), HW_ADDR_TO_STR(&addr));
- if (hashmap_get(link->manager->links_by_hw_addr, &link->hw_addr) == link)
- hashmap_remove(link->manager->links_by_hw_addr, &link->hw_addr);
+ hashmap_remove_value(link->manager->links_by_hw_addr, &link->hw_addr, link);
}
link->hw_addr = addr;