summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/test-ndisc-ra.c
diff options
context:
space:
mode:
authorMichael Marley <michael@michaelmarley.com>2020-07-05 12:46:27 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-07-07 03:49:25 +0200
commitd469cea3bde53bc39317c8b433c825bb4790cbe5 (patch)
treea29f6c3afe4477d6aa2c5ca881b949173573debe /src/libsystemd-network/test-ndisc-ra.c
parentMerge pull request #16374 from keszybz/docs-and-networkd (diff)
downloadsystemd-d469cea3bde53bc39317c8b433c825bb4790cbe5.tar.xz
systemd-d469cea3bde53bc39317c8b433c825bb4790cbe5.zip
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;