Lines Matching refs:link

12 static int static_ipv4acd_address_remove(Link *link, Address *address, bool on_conflict) {  in static_ipv4acd_address_remove()  argument
15 assert(link); in static_ipv4acd_address_remove()
25 …log_link_warning(link, "Dropping address "IPV4_ADDRESS_FMT_STR", as an address conflict was detect… in static_ipv4acd_address_remove()
28 … log_link_debug(link, "Removing address "IPV4_ADDRESS_FMT_STR", as the ACD client is stopped.", in static_ipv4acd_address_remove()
33 … return log_link_warning_errno(link, r, "Failed to remove address "IPV4_ADDRESS_FMT_STR": %m", in static_ipv4acd_address_remove()
39 static int dhcp4_address_on_conflict(Link *link, Address *address) { in dhcp4_address_on_conflict() argument
42 assert(link); in dhcp4_address_on_conflict()
43 assert(link->dhcp_client); in dhcp4_address_on_conflict()
45 r = sd_dhcp_client_send_decline(link->dhcp_client); in dhcp4_address_on_conflict()
47 log_link_warning_errno(link, r, "Failed to send DHCP DECLINE, ignoring: %m"); in dhcp4_address_on_conflict()
49 if (!link->dhcp_lease) in dhcp4_address_on_conflict()
53 log_link_warning(link, "Dropping DHCPv4 lease, as an address conflict was detected."); in dhcp4_address_on_conflict()
54 r = dhcp4_lease_lost(link); in dhcp4_address_on_conflict()
56 return log_link_warning_errno(link, r, "Failed to drop DHCPv4 lease: %m"); in dhcp4_address_on_conflict()
67 Link *link; in on_acd() local
73 assert(address->link); in on_acd()
77 link = address->link; in on_acd()
82 r = static_ipv4acd_address_remove(link, address, /* on_conflict = */ false); in on_acd()
84 link_enter_failed(link); in on_acd()
92 log_link_debug(link, "Successfully claimed address "IPV4_ADDRESS_FMT_STR, in on_acd()
99 …log_link_warning(link, "Dropping address "IPV4_ADDRESS_FMT_STR", as an address conflict was detect… in on_acd()
103 r = static_ipv4acd_address_remove(link, address, /* on_conflict = */ true); in on_acd()
105 r = dhcp4_address_on_conflict(link, address); in on_acd()
107 link_enter_failed(link); in on_acd()
131 Link *link; in ipv4acd_configure() local
136 link = ASSERT_PTR(address->link); in ipv4acd_configure()
144 if (link->hw_addr.length != ETH_ALEN || hw_addr_is_null(&link->hw_addr)) in ipv4acd_configure()
155 log_link_debug(link, "Configuring IPv4ACD for address "IPV4_ADDRESS_FMT_STR, in ipv4acd_configure()
162 r = sd_ipv4acd_attach_event(address->acd, link->manager->event, 0); in ipv4acd_configure()
166 r = sd_ipv4acd_set_ifindex(address->acd, link->ifindex); in ipv4acd_configure()
170 r = sd_ipv4acd_set_mac(address->acd, &link->hw_addr.ether); in ipv4acd_configure()
182 r = sd_ipv4acd_set_check_mac_callback(address->acd, ipv4acd_check_mac, link->manager); in ipv4acd_configure()
186 if (link_has_carrier(link)) { in ipv4acd_configure()
196 int ipv4acd_update_mac(Link *link) { in ipv4acd_update_mac() argument
200 assert(link); in ipv4acd_update_mac()
202 if (link->hw_addr.length != ETH_ALEN) in ipv4acd_update_mac()
204 if (ether_addr_is_null(&link->hw_addr.ether)) in ipv4acd_update_mac()
207 SET_FOREACH(address, link->addresses) { in ipv4acd_update_mac()
211 k = sd_ipv4acd_set_mac(address->acd, &link->hw_addr.ether); in ipv4acd_update_mac()
216 link_enter_failed(link); in ipv4acd_update_mac()
221 int ipv4acd_start(Link *link) { in ipv4acd_start() argument
225 assert(link); in ipv4acd_start()
227 SET_FOREACH(address, link->addresses) { in ipv4acd_start()
242 int ipv4acd_stop(Link *link) { in ipv4acd_stop() argument
246 assert(link); in ipv4acd_stop()
248 SET_FOREACH(address, link->addresses) { in ipv4acd_stop()
260 int ipv4acd_set_ifname(Link *link) { in ipv4acd_set_ifname() argument
264 assert(link); in ipv4acd_set_ifname()
266 SET_FOREACH(address, link->addresses) { in ipv4acd_set_ifname()
270 r = sd_ipv4acd_set_ifname(address->acd, link->ifname); in ipv4acd_set_ifname()