Lines 1365-1371
Link Here
|
1365 |
assert(link->network); |
1365 |
assert(link->network); |
1366 |
assert(link->state != _LINK_STATE_INVALID); |
1366 |
assert(link->state != _LINK_STATE_INVALID); |
1367 |
|
1367 |
|
|
|
1368 |
if (link->address_remove_messages != 0) { |
1369 |
log_link_debug(link, "Removing old addresses, new addresses will be configured later."); |
1370 |
link->request_static_addresses = true; |
1371 |
return 0; |
1372 |
} |
1373 |
|
1368 |
/* Reset all *_configured flags we are configuring. */ |
1374 |
/* Reset all *_configured flags we are configuring. */ |
|
|
1375 |
link->request_static_addresses = false; |
1369 |
link->addresses_configured = false; |
1376 |
link->addresses_configured = false; |
1370 |
link->addresses_ready = false; |
1377 |
link->addresses_ready = false; |
1371 |
link->neighbors_configured = false; |
1378 |
link->neighbors_configured = false; |
Lines 2884-2889
Link Here
|
2884 |
return 0; |
2891 |
return 0; |
2885 |
} |
2892 |
} |
2886 |
|
2893 |
|
|
|
2894 |
static int remove_static_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { |
2895 |
int r; |
2896 |
|
2897 |
assert(m); |
2898 |
assert(link); |
2899 |
assert(link->ifname); |
2900 |
assert(link->address_remove_messages > 0); |
2901 |
|
2902 |
link->address_remove_messages--; |
2903 |
|
2904 |
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER)) |
2905 |
return 1; |
2906 |
|
2907 |
r = sd_netlink_message_get_errno(m); |
2908 |
if (r < 0 && r != -EADDRNOTAVAIL) |
2909 |
log_link_message_warning_errno(link, m, r, "Could not drop address"); |
2910 |
else if (r >= 0) |
2911 |
(void) manager_rtnl_process_address(rtnl, m, link->manager); |
2912 |
|
2913 |
if (link->address_remove_messages == 0 && link->request_static_addresses) { |
2914 |
link_set_state(link, LINK_STATE_CONFIGURING); |
2915 |
r = link_request_set_addresses(link); |
2916 |
if (r < 0) |
2917 |
link_enter_failed(link); |
2918 |
} |
2919 |
|
2920 |
return 1; |
2921 |
} |
2922 |
|
2887 |
static int link_drop_config(Link *link) { |
2923 |
static int link_drop_config(Link *link) { |
2888 |
Address *address, *pool_address; |
2924 |
Address *address, *pool_address; |
2889 |
Neighbor *neighbor; |
2925 |
Neighbor *neighbor; |
Lines 2896-2913
Link Here
|
2896 |
if (address->family == AF_INET6 && in_addr_is_link_local(AF_INET6, &address->in_addr) == 1 && link_ipv6ll_enabled(link)) |
2932 |
if (address->family == AF_INET6 && in_addr_is_link_local(AF_INET6, &address->in_addr) == 1 && link_ipv6ll_enabled(link)) |
2897 |
continue; |
2933 |
continue; |
2898 |
|
2934 |
|
2899 |
r = address_remove(address, link, NULL); |
2935 |
r = address_remove(address, link, remove_static_address_handler); |
2900 |
if (r < 0) |
2936 |
if (r < 0) |
2901 |
return r; |
2937 |
return r; |
2902 |
|
2938 |
|
|
|
2939 |
link->address_remove_messages++; |
2940 |
|
2903 |
/* If this address came from an address pool, clean up the pool */ |
2941 |
/* If this address came from an address pool, clean up the pool */ |
2904 |
LIST_FOREACH(addresses, pool_address, link->pool_addresses) { |
2942 |
LIST_FOREACH(addresses, pool_address, link->pool_addresses) |
2905 |
if (address_equal(address, pool_address)) { |
2943 |
if (address_equal(address, pool_address)) { |
2906 |
LIST_REMOVE(addresses, link->pool_addresses, pool_address); |
2944 |
LIST_REMOVE(addresses, link->pool_addresses, pool_address); |
2907 |
address_free(pool_address); |
2945 |
address_free(pool_address); |
2908 |
break; |
2946 |
break; |
2909 |
} |
2947 |
} |
2910 |
} |
|
|
2911 |
} |
2948 |
} |
2912 |
|
2949 |
|
2913 |
SET_FOREACH(neighbor, link->neighbors, i) { |
2950 |
SET_FOREACH(neighbor, link->neighbors, i) { |