1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

network: move link_configure_ipv4_dad()

This commit is contained in:
Yu Watanabe 2020-10-02 12:05:20 +09:00
parent da4d3a612d
commit b87d6a8284
3 changed files with 20 additions and 20 deletions

View File

@ -1324,7 +1324,7 @@ static void static_address_on_acd(sd_ipv4acd *acd, int event, void *userdata) {
return;
}
int configure_ipv4_duplicate_address_detection(Link *link, Address *address) {
static int ipv4_dad_configure(Link *link, Address *address) {
int r;
assert(link);
@ -1361,6 +1361,24 @@ int configure_ipv4_duplicate_address_detection(Link *link, Address *address) {
return 0;
}
int link_configure_ipv4_dad(Link *link) {
Address *address;
int r;
assert(link);
assert(link->network);
LIST_FOREACH(addresses, address, link->network->static_addresses)
if (address->family == AF_INET &&
FLAGS_SET(address->duplicate_address_detection, ADDRESS_FAMILY_IPV4)) {
r = ipv4_dad_configure(link, address);
if (r < 0)
return log_link_error_errno(link, r, "Failed to configure IPv4ACD: %m");
}
return 0;
}
int config_parse_broadcast(
const char *unit,
const char *filename,

View File

@ -68,7 +68,6 @@ int address_configure(Address *address, Link *link, link_netlink_message_handler
int address_remove(Address *address, Link *link, link_netlink_message_handler_t callback);
bool address_equal(Address *a1, Address *a2);
bool address_is_ready(const Address *a);
int configure_ipv4_duplicate_address_detection(Link *link, Address *address);
int generate_ipv6_eui_64_address(Link *link, struct in6_addr *ret);
@ -79,6 +78,7 @@ int link_drop_addresses(Link *link);
int link_drop_foreign_addresses(Link *link);
int link_serialize_addresses(Link *link, FILE *f);
int link_deserialize_addresses(Link *link, const char *addresses);
int link_configure_ipv4_dad(Link *link);
int manager_rtnl_process_address(sd_netlink *nl, sd_netlink_message *message, Manager *m);

View File

@ -2404,24 +2404,6 @@ static int link_drop_config(Link *link) {
return 0;
}
static int link_configure_ipv4_dad(Link *link) {
Address *address;
int r;
assert(link);
assert(link->network);
LIST_FOREACH(addresses, address, link->network->static_addresses)
if (address->family == AF_INET &&
FLAGS_SET(address->duplicate_address_detection, ADDRESS_FAMILY_IPV4)) {
r = configure_ipv4_duplicate_address_detection(link, address);
if (r < 0)
return log_link_error_errno(link, r, "Failed to configure IPv4ACD: %m");
}
return 0;
}
static int link_configure_traffic_control(Link *link) {
TrafficControl *tc;
int r;