diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-21 04:28:09 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-07-01 00:49:02 +0900 |
commit | f8d6397ac21bc95989b6220eeb914af8f8d120d3 (patch) | |
tree | 30364095d5baf5b8804fe98cec53114faf6cdada /src/network/networkd-ipv4ll.c | |
parent | a1e35fca46681eab34608377b04d77f68128483a (diff) | |
download | systemd-f8d6397ac21bc95989b6220eeb914af8f8d120d3.tar.gz |
network: ipv4ll: reset MAC address without stopping sd-ipv4ll engine
Diffstat (limited to 'src/network/networkd-ipv4ll.c')
-rw-r--r-- | src/network/networkd-ipv4ll.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/network/networkd-ipv4ll.c b/src/network/networkd-ipv4ll.c index e1dbbabf8f..be6fedf90f 100644 --- a/src/network/networkd-ipv4ll.c +++ b/src/network/networkd-ipv4ll.c @@ -184,31 +184,16 @@ int ipv4ll_configure(Link *link) { } int ipv4ll_update_mac(Link *link) { - bool restart; - int r; - assert(link); + if (link->hw_addr.length != ETH_ALEN) + return 0; + if (ether_addr_is_null(&link->hw_addr.ether)) + return 0; if (!link->ipv4ll) return 0; - restart = sd_ipv4ll_is_running(link->ipv4ll) > 0; - - r = sd_ipv4ll_stop(link->ipv4ll); - if (r < 0) - return r; - - r = sd_ipv4ll_set_mac(link->ipv4ll, &link->hw_addr.ether); - if (r < 0) - return r; - - if (restart) { - r = sd_ipv4ll_start(link->ipv4ll); - if (r < 0) - return r; - } - - return 0; + return sd_ipv4ll_set_mac(link->ipv4ll, &link->hw_addr.ether); } int config_parse_ipv4ll( |