summaryrefslogtreecommitdiff
path: root/src/network/networkd-ipv4ll.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-06-21 04:28:09 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-07-01 00:49:02 +0900
commitf8d6397ac21bc95989b6220eeb914af8f8d120d3 (patch)
tree30364095d5baf5b8804fe98cec53114faf6cdada /src/network/networkd-ipv4ll.c
parenta1e35fca46681eab34608377b04d77f68128483a (diff)
downloadsystemd-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.c25
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(