summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-ndisc-ra.c
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/libsystemd-network/test-ndisc-ra.c
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/libsystemd-network/test-ndisc-ra.c')
-rw-r--r--src/libsystemd-network/test-ndisc-ra.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/test-ndisc-ra.c b/src/libsystemd-network/test-ndisc-ra.c
index d759ec03a8..7c59418ca7 100644
--- a/src/libsystemd-network/test-ndisc-ra.c
+++ b/src/libsystemd-network/test-ndisc-ra.c
@@ -284,7 +284,7 @@ static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdat
return 0;
}
- assert_se(sd_radv_stop(ra) >= 0);
+ assert_se(sd_radv_stop(ra, true) >= 0);
test_stopped = true;
return 0;