Commit dcf4706d82 for frr
commit dcf4706d8289c03b2fa6893c57dd15d796408186
Author: Justin Iurman <justin.iurman@6wind.com>
Date: Fri Nov 6 18:05:48 2026 +0100
zebra: don't flap an SRv6 locator when its prefix is unchanged
The "prefix" command of an SRv6 locator always ends with
zebra_srv6_locator_format_set(), which notifies the clients that the
locator is deleted, releases all the SIDs allocated from it, and
notifies the clients that the locator is added again, even if the
prefix and the block, node and function lengths are unchanged.
Entering the same "prefix" command again, e.g., when the whole
configuration is reapplied, therefore flaps the locator: the clients
withdraw and uninstall all their SIDs (e.g., the L3VPN SIDs of bgpd),
then allocate, install and advertise them again.
Do nothing when the locator is up and its prefix and lengths are
unchanged.
Fixes: 779d4c2702ac ("zebra: CLI to specify format of an SRv6 locator")
Signed-off-by: Justin Iurman <justin.iurman@6wind.com>
diff --git a/zebra/zebra_srv6_vty.c b/zebra/zebra_srv6_vty.c
index 79e495b250..b7cb5d22c4 100644
--- a/zebra/zebra_srv6_vty.c
+++ b/zebra/zebra_srv6_vty.c
@@ -971,6 +971,13 @@ DEFPY (locator_prefix,
return CMD_WARNING_CONFIG_FAILED;
}
+ /* Nothing changed (e.g., configuration replayed): do not flap the locator */
+ if (locator->status_up && prefix_same(&locator->prefix, prefix) &&
+ locator->block_bits_length == block_bit_len &&
+ locator->node_bits_length == node_bit_len &&
+ locator->function_bits_length == func_bit_len && locator->argument_bits_length == 0)
+ return CMD_SUCCESS;
+
locator->prefix = *prefix;
locator->block_bits_length = block_bit_len;
locator->node_bits_length = node_bit_len;