summaryrefslogtreecommitdiff
path: root/src/systemd/sd-radv.h
diff options
context:
space:
mode:
authorMichael Marley <michael@michaelmarley.com>2020-07-05 06:46:27 -0400
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-07-07 10:49:25 +0900
commitd469cea3bde53bc39317c8b433c825bb4790cbe5 (patch)
treea29f6c3afe4477d6aa2c5ca881b949173573debe /src/systemd/sd-radv.h
parentc82012605b3d578710996e29e8fa4ef8ff35a610 (diff)
downloadsystemd-d469cea3bde53bc39317c8b433c825bb4790cbe5.tar.gz
network: Don't send RA with zero router lifetime when restarting radv
While investigating https://github.com/systemd/systemd/issues/16356, I discovered that networkd stops the radv service before adding or updating prefixes and then starts it again. This causes networkd to send an RA with a router lifetime of zero, causing the routes to flap on systems receiving the RA for a fraction of a second before radv is started again and proper RAs are sent. That has the potential to cause issues with latency-sensitive traffic like gaming or VoIP. This patch adds a boolean argument to the sd_radv_stop() function to control this behavior. The zero lifetime RA is still sent whenever radv is actually being stopped, but when it is being restarted for a prefix update (from networkd-dhcp6.c), the final RA is no longer sent to avoid the route flapping.
Diffstat (limited to 'src/systemd/sd-radv.h')
-rw-r--r--src/systemd/sd-radv.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/systemd/sd-radv.h b/src/systemd/sd-radv.h
index 011e40d8a5..763d5ddd87 100644
--- a/src/systemd/sd-radv.h
+++ b/src/systemd/sd-radv.h
@@ -22,6 +22,7 @@
#include <inttypes.h>
#include <net/ethernet.h>
#include <netinet/in.h>
+#include <stdbool.h>
#include <sys/types.h>
#include "_sd-common.h"
@@ -49,7 +50,7 @@ int sd_radv_detach_event(sd_radv *nd);
sd_event *sd_radv_get_event(sd_radv *ra);
int sd_radv_start(sd_radv *ra);
-int sd_radv_stop(sd_radv *ra);
+int sd_radv_stop(sd_radv *ra, bool zero_router_lifetime);
int sd_radv_set_ifindex(sd_radv *ra, int interface_index);
int sd_radv_set_mac(sd_radv *ra, const struct ether_addr *mac_addr);