summaryrefslogtreecommitdiff
path: root/src/network/networkd-radv.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-10-02 20:55:18 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-10-07 02:50:51 +0900
commitbe9363ccab4410add5bdd6583f77f73309a94a08 (patch)
tree0ec687d14dea34fb3ec17af6472135774d6bfeb1 /src/network/networkd-radv.c
parenteebba6dc24fb6efb38a5ee21e54d2cf2b0ab956d (diff)
downloadsystemd-be9363ccab4410add5bdd6583f77f73309a94a08.tar.gz
network: introduce radv_update_mac()
Diffstat (limited to 'src/network/networkd-radv.c')
-rw-r--r--src/network/networkd-radv.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c
index 81350a3e05..dbdbdef80d 100644
--- a/src/network/networkd-radv.c
+++ b/src/network/networkd-radv.c
@@ -686,6 +686,36 @@ int radv_configure(Link *link) {
return 0;
}
+int radv_update_mac(Link *link) {
+ bool restart;
+ int r;
+
+ assert(link);
+
+ if (!link->radv)
+ return 0;
+
+ restart = sd_radv_is_running(link->radv);
+
+ if (restart) {
+ r = sd_radv_stop(link->radv);
+ if (r < 0)
+ return r;
+ }
+
+ r = sd_radv_set_mac(link->radv, &link->mac);
+ if (r < 0)
+ return r;
+
+ if (restart) {
+ r = sd_radv_start(link->radv);
+ if (r < 0)
+ return r;
+ }
+
+ return 0;
+}
+
int radv_add_prefix(
Link *link,
const struct in6_addr *prefix,