summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2025-09-25 15:33:14 +0100
committerGitHub <noreply@github.com>2025-09-25 15:33:14 +0100
commit137b20e4253f02dc7e394b592291ab4f1fc5da9a (patch)
tree8d319224583923038a151d9e964fe1872c38fec5 /scripts
parented29cddb7dcd6ebabf0b73d40679dea42b104a92 (diff)
parentb182d0fa48a173e0c6842f75d1753f413d5cabd7 (diff)
downloadvyos-build-137b20e4253f02dc7e394b592291ab4f1fc5da9a.tar.gz
vyos-build-137b20e4253f02dc7e394b592291ab4f1fc5da9a.zip
Merge pull request #1040 from hedrok/T6516-isis-advertise-passive-only
T6516: frr: fix isisd advertise-passive-only
Diffstat (limited to 'scripts')
-rw-r--r--scripts/package-build/frr/patches/frr/0008-isis-fix-advertise-passive-only-routes-install.patch133
1 files changed, 133 insertions, 0 deletions
diff --git a/scripts/package-build/frr/patches/frr/0008-isis-fix-advertise-passive-only-routes-install.patch b/scripts/package-build/frr/patches/frr/0008-isis-fix-advertise-passive-only-routes-install.patch
new file mode 100644
index 00000000..4861c138
--- /dev/null
+++ b/scripts/package-build/frr/patches/frr/0008-isis-fix-advertise-passive-only-routes-install.patch
@@ -0,0 +1,133 @@
+From e2dbe69dd830d01af5bf0202b347524b3151e4e6 Mon Sep 17 00:00:00 2001
+From: Kyrylo Yatsenko <hedrok@gmail.com>
+Date: Fri, 19 Sep 2025 09:17:03 +0300
+Subject: [PATCH] isis: fix advertise-passive-only routes install
+
+When advertise-passive-only is set don't ignore active circuits
+completely - we still need to install routes from those interfaces.
+
+Update test to check this.
+
+Fixes #16325
+
+Signed-off-by: Kyrylo Yatsenko <hedrok@gmail.com>
+---
+ isisd/isis_lsp.c | 43 ++++++++-----------
+ tests/topotests/isis_topo1/test_isis_topo1.py | 30 ++++++++++---
+ 2 files changed, 42 insertions(+), 31 deletions(-)
+
+diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
+index d588af314c..0aefba95a2 100644
+--- a/isisd/isis_lsp.c
++++ b/isisd/isis_lsp.c
+@@ -1308,37 +1308,30 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
+ continue;
+ }
+
+- if (area->advertise_passive_only && !circuit->is_passive) {
+- lsp_debug(
+- "ISIS (%s): Circuit is not passive, ignoring.",
+- area->area_tag);
+- continue;
+- }
+-
+ uint32_t metric = area->oldmetric
+ ? circuit->metric[level - 1]
+ : circuit->te_metric[level - 1];
+
+- if (circuit->ip_router && circuit->ip_addrs->count > 0) {
+- lsp_debug(
+- "ISIS (%s): Circuit has IPv4 active, adding respective TLVs.",
+- area->area_tag);
+- struct listnode *ipnode;
+- struct prefix_ipv4 *ipv4;
+- for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, ipnode,
+- ipv4))
+- lsp_build_internal_reach_ipv4(lsp, area, ipv4,
+- metric);
+- }
++ if (area->advertise_passive_only && !circuit->is_passive) {
++ lsp_debug("ISIS (%s): Circuit is not passive, don't add prefixes.",
++ area->area_tag);
++ } else {
++ if (circuit->ip_router && circuit->ip_addrs->count > 0) {
++ lsp_debug("ISIS (%s): Circuit has IPv4 active, adding respective TLVs.",
++ area->area_tag);
++ struct listnode *ipnode;
++ struct prefix_ipv4 *ipv4;
++ for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, ipnode, ipv4))
++ lsp_build_internal_reach_ipv4(lsp, area, ipv4, metric);
++ }
+
+- if (circuit->ipv6_router && circuit->ipv6_non_link->count > 0) {
+- struct listnode *ipnode;
+- struct prefix_ipv6 *ipv6;
++ if (circuit->ipv6_router && circuit->ipv6_non_link->count > 0) {
++ struct listnode *ipnode;
++ struct prefix_ipv6 *ipv6;
+
+- for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link,
+- ipnode, ipv6))
+- lsp_build_internal_reach_ipv6(lsp, area, ipv6,
+- metric);
++ for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, ipnode, ipv6))
++ lsp_build_internal_reach_ipv6(lsp, area, ipv6, metric);
++ }
+ }
+
+ switch (circuit->circ_type) {
+diff --git a/tests/topotests/isis_topo1/test_isis_topo1.py b/tests/topotests/isis_topo1/test_isis_topo1.py
+index 1cec2f16f0..5d65b353cf 100644
+--- a/tests/topotests/isis_topo1/test_isis_topo1.py
++++ b/tests/topotests/isis_topo1/test_isis_topo1.py
+@@ -148,12 +148,9 @@ def test_isis_route_installation():
+ filename = "{0}/{1}/{1}_route.json".format(CWD, rname)
+ expected = json.loads(open(filename, "r").read())
+
+- def compare_isis_installed_routes(router, expected):
+- "Helper function to test ISIS routes installed in rib."
+- actual = router.vtysh_cmd("show ip route json", isjson=True)
+- return topotest.json_cmp(actual, expected)
+-
+- test_func = functools.partial(compare_isis_installed_routes, router, expected)
++ test_func = functools.partial(
++ _helper_compare_isis_installed_routes, router, expected
++ )
+ (result, _) = topotest.run_and_expect(test_func, None, wait=1, count=10)
+ assertmsg = "Router '{}' routes mismatch".format(rname)
+ assert result, assertmsg
+@@ -565,6 +562,21 @@ def test_isis_advertise_passive_only():
+ )
+ assert result is True, result
+
++ logger.info("Checking router for installed ISIS routes with advertise-passive-only")
++
++ # routes must be installed
++ rname = "r1"
++ router = r1
++ filename = "{0}/{1}/{1}_route.json".format(CWD, rname)
++ expected = json.loads(open(filename, "r").read())
++
++ test_func = functools.partial(
++ _helper_compare_isis_installed_routes, router, expected
++ )
++ (result, _) = topotest.run_and_expect(test_func, None, wait=1, count=10)
++ assertmsg = "Router '{}' routes mismatch:\n{}".format(rname, _)
++ assert result, assertmsg
++
+
+ def test_isis_hello_padding_during_adjacency_formation():
+ """Check that IIH packets is only padded when adjacency is still being formed
+@@ -842,3 +854,9 @@ def parse_topology(lines, level):
+ continue
+
+ return areas
++
++
++def _helper_compare_isis_installed_routes(router, expected):
++ "Helper function to test ISIS routes installed in rib."
++ actual = router.vtysh_cmd("show ip route json", isjson=True)
++ return topotest.json_cmp(actual, expected)
+--
+2.50.1
+