diff --git a/SOURCES/0010-bfd-reload.patch b/SOURCES/0010-bfd-reload.patch new file mode 100644 index 0000000..b153592 --- /dev/null +++ b/SOURCES/0010-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/SPECS/frr.spec b/SPECS/frr.spec index 6063974..a988232 100644 --- a/SPECS/frr.spec +++ b/SPECS/frr.spec @@ -5,7 +5,7 @@ Name: frr Version: 7.5 -Release: 8%{?checkout}%{?dist} +Release: 9%{?checkout}%{?dist} Summary: Routing daemon License: GPLv2+ URL: http://www.frrouting.org @@ -39,6 +39,7 @@ Patch0006: 0006-CVE-2020-12831.patch Patch0007: 0007-frrinit.patch Patch0008: 0008-ospf-multi-instance.patch Patch0009: 0009-bgp-ttl-security.patch +Patch0010: 0010-bfd-reload.patch %description FRRouting is free software that manages TCP/IP based routing protocols. It takes @@ -199,6 +200,9 @@ make check PYTHON=%{__python3} %{_tmpfilesdir}/%{name}.conf %changelog +* Fri Dec 10 2021 Michal Ruprich - 7.5-9 +- Resolves: #2029958 - FRR reloader generating invalid BFD configurations, exits with error + * Tue Nov 16 2021 Michal Ruprich - 7.5-8 - Resolves: #2021819 - Rebuilding for the new json-c