mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-12 08:58:20 +03:00
network: update MAC address in IPv4ACD client for DHCP4
This commit is contained in:
parent
a7df5cae54
commit
5431227400
@ -651,6 +651,34 @@ static int dhcp4_configure_dad(Link *link) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int dhcp4_dad_update_mac(Link *link) {
|
||||||
|
bool running;
|
||||||
|
int r;
|
||||||
|
|
||||||
|
assert(link);
|
||||||
|
|
||||||
|
if (!link->dhcp_acd)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
running = sd_ipv4acd_is_running(link->dhcp_acd);
|
||||||
|
|
||||||
|
r = sd_ipv4acd_stop(link->dhcp_acd);
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
r = sd_ipv4acd_set_mac(link->dhcp_acd, &link->mac);
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
if (running) {
|
||||||
|
r = sd_ipv4acd_start(link->dhcp_acd, true);
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int dhcp4_start_acd(Link *link) {
|
static int dhcp4_start_acd(Link *link) {
|
||||||
union in_addr_union addr;
|
union in_addr_union addr;
|
||||||
struct in_addr old;
|
struct in_addr old;
|
||||||
@ -1462,6 +1490,10 @@ int dhcp4_update_mac(Link *link) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
r = dhcp4_dad_update_mac(link);
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user