mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-10 00:58:20 +03:00
Merge pull request #5589 from jasonreeder/claimed_address_fix
libsystemd-network: sd-ipv4ll: acquire new address after claimed addr…
This commit is contained in:
commit
88be0aa226
@ -248,6 +248,12 @@ static int ipv4ll_pick_address(sd_ipv4ll *ll) {
|
||||
return sd_ipv4ll_set_address(ll, &(struct in_addr) { addr });
|
||||
}
|
||||
|
||||
int sd_ipv4ll_restart(sd_ipv4ll *ll) {
|
||||
ll->address = 0;
|
||||
|
||||
return sd_ipv4ll_start(ll);
|
||||
}
|
||||
|
||||
#define MAC_HASH_KEY SD_ID128_MAKE(df,04,22,98,3f,ad,14,52,f9,87,2e,d1,9c,70,e2,f2)
|
||||
|
||||
int sd_ipv4ll_start(sd_ipv4ll *ll) {
|
||||
|
@ -179,12 +179,22 @@ static void ipv4ll_handler(sd_ipv4ll *ll, int event, void *userdata) {
|
||||
|
||||
switch(event) {
|
||||
case SD_IPV4LL_EVENT_STOP:
|
||||
r = ipv4ll_address_lost(link);
|
||||
if (r < 0) {
|
||||
link_enter_failed(link);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case SD_IPV4LL_EVENT_CONFLICT:
|
||||
r = ipv4ll_address_lost(link);
|
||||
if (r < 0) {
|
||||
link_enter_failed(link);
|
||||
return;
|
||||
}
|
||||
|
||||
r = sd_ipv4ll_restart(ll);
|
||||
if (r < 0)
|
||||
log_link_warning(link, "Could not acquire IPv4 link-local address");
|
||||
break;
|
||||
case SD_IPV4LL_EVENT_BIND:
|
||||
r = ipv4ll_address_claimed(ll, link);
|
||||
|
@ -47,6 +47,7 @@ int sd_ipv4ll_set_ifindex(sd_ipv4ll *ll, int interface_index);
|
||||
int sd_ipv4ll_set_address(sd_ipv4ll *ll, const struct in_addr *address);
|
||||
int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, uint64_t seed);
|
||||
int sd_ipv4ll_is_running(sd_ipv4ll *ll);
|
||||
int sd_ipv4ll_restart(sd_ipv4ll *ll);
|
||||
int sd_ipv4ll_start(sd_ipv4ll *ll);
|
||||
int sd_ipv4ll_stop(sd_ipv4ll *ll);
|
||||
sd_ipv4ll *sd_ipv4ll_ref(sd_ipv4ll *ll);
|
||||
|
Loading…
x
Reference in New Issue
Block a user