diff --git a/SOURCES/0008-bfd-reload.patch b/SOURCES/0008-bfd-reload.patch new file mode 100644 index 0000000..b153592 --- /dev/null +++ b/SOURCES/0008-bfd-reload.patch @@ -0,0 +1,60 @@ +From 46a2b560fa84c5f8ece8dbb82cbf355af675ad41 Mon Sep 17 00:00:00 2001 +From: Rafael Zalamena +Date: Tue, 19 Jan 2021 08:49:23 -0300 +Subject: [PATCH] tools: fix frr-reload BFD profile support + +Fix the handling of multiple BFD profiles by adding the appropriated +code to push/pop contexts inside BFD configuration node. + +Signed-off-by: Rafael Zalamena +--- + tools/frr-reload.py | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +diff --git a/tools/frr-reload.py b/tools/frr-reload.py +index da005b6f874..ca6fe81f007 100755 +--- a/tools/frr-reload.py ++++ b/tools/frr-reload.py +@@ -533,6 +533,18 @@ def load_contexts(self): + if line.startswith('!') or line.startswith('#'): + continue + ++ if (len(ctx_keys) == 2 ++ and ctx_keys[0].startswith('bfd') ++ and ctx_keys[1].startswith('profile ') ++ and line == 'end'): ++ log.debug('LINE %-50s: popping from sub context, %-50s', line, ctx_keys) ++ ++ if main_ctx_key: ++ self.save_contexts(ctx_keys, current_context_lines) ++ ctx_keys = copy.deepcopy(main_ctx_key) ++ current_context_lines = [] ++ continue ++ + # one line contexts + # there is one exception though: ldpd accepts a 'router-id' clause + # as part of its 'mpls ldp' config context. If we are processing +@@ -649,6 +661,22 @@ def load_contexts(self): + log.debug('LINE %-50s: entering sub-sub-context, append to ctx_keys', line) + ctx_keys.append(line) + ++ elif ( ++ line.startswith('profile ') ++ and len(ctx_keys) == 1 ++ and ctx_keys[0].startswith('bfd') ++ ): ++ ++ # Save old context first ++ self.save_contexts(ctx_keys, current_context_lines) ++ current_context_lines = [] ++ main_ctx_key = copy.deepcopy(ctx_keys) ++ log.debug( ++ "LINE %-50s: entering BFD profile sub-context, append to ctx_keys", ++ line ++ ) ++ ctx_keys.append(line) ++ + else: + # Continuing in an existing context, add non-commented lines to it + current_context_lines.append(line) + diff --git a/SOURCES/0012-bfd-peers-crash.patch b/SOURCES/0012-bfd-peers-crash.patch new file mode 100644 index 0000000..1e2d78e --- /dev/null +++ b/SOURCES/0012-bfd-peers-crash.patch @@ -0,0 +1,25 @@ +From 1d923374f64e099d734899aff219d90cb0213fa6 Mon Sep 17 00:00:00 2001 +From: Emanuele Bovisio +Date: Thu, 5 Nov 2020 14:27:51 +0100 +Subject: [PATCH] bfdd: fix crash on show bfd peers counters json + +wrong pointer passed to bfd_id_iterate function + +Signed-off-by: Emanuele Bovisio +--- + bfdd/bfdd_vty.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bfdd/bfdd_vty.c b/bfdd/bfdd_vty.c +index a3f1638e5f6..837a7b7d7d6 100644 +--- a/bfdd/bfdd_vty.c ++++ b/bfdd/bfdd_vty.c +@@ -447,7 +447,7 @@ static void _display_peers_counter(struct vty *vty, char *vrfname, bool use_json + + jo = json_object_new_array(); + bvt.jo = jo; +- bfd_id_iterate(_display_peer_counter_json_iter, jo); ++ bfd_id_iterate(_display_peer_counter_json_iter, &bvt); + + vty_out(vty, "%s\n", json_object_to_json_string_ext(jo, 0)); + json_object_free(jo); diff --git a/SPECS/frr.spec b/SPECS/frr.spec index 6445ed2..73a732d 100644 --- a/SPECS/frr.spec +++ b/SPECS/frr.spec @@ -5,7 +5,7 @@ Name: frr Version: 7.5 -Release: 4%{?checkout}%{?dist} +Release: 4%{?checkout}%{?dist}.2 Summary: Routing daemon License: GPLv2+ URL: http://www.frrouting.org @@ -37,6 +37,8 @@ Patch0003: 0003-disable-eigrp-crypto.patch Patch0004: 0004-fips-mode.patch Patch0006: 0006-CVE-2020-12831.patch Patch0007: 0007-frrinit.patch +Patch0008: 0008-bfd-reload.patch +Patch0012: 0012-bfd-peers-crash.patch %description FRRouting is free software that manages TCP/IP based routing protocols. It takes @@ -197,6 +199,12 @@ make check PYTHON=%{__python3} %{_tmpfilesdir}/%{name}.conf %changelog +* Wed Jan 05 2022 Michal Ruprich - 7.5-4.2 +- Resolves: #2037200 - Bfdd crash in metallb CI + +* Fri Dec 10 2021 Michal Ruprich - 7.5-4.1 +- Resolves: #2031077 - FRR reloader generating invalid BFD configurations, exits with error + * Tue Jan 12 2021 root - 7.5-4 - Related: #1889323 - Fixing start-up with old config file