network: Don't send RA with zero router lifetime when restarting radv
authorMichael Marley <michael@michaelmarley.com>
Sun, 5 Jul 2020 10:46:27 +0000 (06:46 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Jul 2020 01:49:25 +0000 (10:49 +0900)
commitd469cea3bde53bc39317c8b433c825bb4790cbe5
treea29f6c3afe4477d6aa2c5ca881b949173573debe
parentc82012605b3d578710996e29e8fa4ef8ff35a610
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.
src/libsystemd-network/sd-radv.c
src/libsystemd-network/test-ndisc-ra.c
src/network/networkd-dhcp6.c
src/network/networkd-link.c
src/systemd/sd-radv.h