import frr-8.2.2-4.el9

This commit is contained in:
CentOS Sources 2022-09-27 05:41:20 -04:00 committed by Stepan Oksanichenko
parent d09de17a4b
commit 3e3b3565fe
9 changed files with 58 additions and 396 deletions

View File

@ -1 +1 @@
5e4505f1289ede3a0d2ce216acfb3f2b2730f09a SOURCES/frr-8.0.tar.gz
6998ebd94682163feb82ee3bed875a5a7740edac SOURCES/frr-8.2.2.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/frr-8.0.tar.gz
SOURCES/frr-8.2.2.tar.gz

View File

@ -27,7 +27,7 @@ index 0b7af18..0533e24 100644
lib/module.h \
lib/monotime.h \
@@ -191,7 +190,6 @@ pkginclude_HEADERS += \
lib/routemap.h \
lib/route_opaque.h \
lib/sbuf.h \
lib/seqlock.h \
- lib/sha256.h \

View File

@ -0,0 +1,30 @@
diff --git a/lib/routemap.c b/lib/routemap.c
index 7f733c811..9afe18d10 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -1799,12 +1799,11 @@ static struct list *route_map_get_index_list(struct route_node **rn,
/*
* This function returns the route-map index that best matches the prefix.
*/
-static struct route_map_index *route_map_get_index(struct route_map *map,
- const struct prefix *prefix,
- void *object,
- uint8_t *match_ret)
+static struct route_map_index *
+route_map_get_index(struct route_map *map, const struct prefix *prefix,
+ void *object, enum route_map_cmd_result_t *match_ret)
{
- int ret = 0;
+ enum route_map_cmd_result_t ret = RMAP_NOMATCH;
struct list *candidate_rmap_list = NULL;
struct route_node *rn = NULL;
struct listnode *ln = NULL, *nn = NULL;
@@ -2559,7 +2558,7 @@ route_map_result_t route_map_apply_ext(struct route_map *map,
if ((!map->optimization_disabled)
&& (map->ipv4_prefix_table || map->ipv6_prefix_table)) {
index = route_map_get_index(map, prefix, match_object,
- (uint8_t *)&match_ret);
+ &match_ret);
if (index) {
index->applied++;
if (rmap_debug)

View File

@ -1,10 +0,0 @@
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index c28a971..72ac201 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Frr Reloader
# Copyright (C) 2014 Cumulus Networks, Inc.
#

View File

@ -1,343 +0,0 @@
From 667dcc277c15c0bddc785f9b949d658f8d815818 Mon Sep 17 00:00:00 2001
From: Igor Ryzhov <iryzhov@nfware.com>
Date: Tue, 10 Aug 2021 21:46:37 +0300
Subject: [PATCH] lib: fix prefix-list duplication check
Currently, when we check the new prefix-list entry for duplication, we
only take filled in fields into account and ignore optional fields.
For example, if we already have `ip prefix-list A 0.0.0.0/0 le 32` and
we try to add `ip prefix-list A 0.0.0.0/0`, it is treated as duplicate.
We should always compare all prefix-list fields when doing the check.
Fixes #9355.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
---
lib/filter.h | 9 ++---
lib/filter_cli.c | 102 ++++++++++-------------------------------------
lib/filter_nb.c | 85 ++++++++++++++++++++++-----------------
3 files changed, 74 insertions(+), 122 deletions(-)
diff --git a/lib/filter.h b/lib/filter.h
index 941fabd38b8..d1956ec019f 100644
--- a/lib/filter.h
+++ b/lib/filter.h
@@ -207,11 +207,10 @@ struct plist_dup_args {
/** Entry action. */
const char *pda_action;
-#define PDA_MAX_VALUES 4
- /** Entry XPath for value. */
- const char *pda_xpath[PDA_MAX_VALUES];
- /** Entry value to match. */
- const char *pda_value[PDA_MAX_VALUES];
+ bool any;
+ struct prefix prefix;
+ int ge;
+ int le;
/** Duplicated entry found in list? */
bool pda_found;
diff --git a/lib/filter_cli.c b/lib/filter_cli.c
index f030ce1b335..45c7544a3b4 100644
--- a/lib/filter_cli.c
+++ b/lib/filter_cli.c
@@ -1196,11 +1196,9 @@ static int plist_remove_if_empty(struct vty *vty, const char *iptype,
static int plist_remove(struct vty *vty, const char *iptype, const char *name,
const char *seq, const char *action,
- const char *prefix_str, const char *ge_str,
- const char *le_str)
+ union prefixconstptr prefix, int ge, int le)
{
int64_t sseq;
- int arg_idx = 0;
struct plist_dup_args pda = {};
char xpath[XPATH_MAXLEN];
char xpath_entry[XPATH_MAXLEN + 32];
@@ -1225,43 +1223,13 @@ static int plist_remove(struct vty *vty, const char *iptype, const char *name,
pda.pda_type = iptype;
pda.pda_name = name;
pda.pda_action = action;
- if (prefix_str) {
- if (strmatch(iptype, "ipv4")) {
- pda.pda_xpath[arg_idx] = "./ipv4-prefix";
- pda.pda_value[arg_idx] = prefix_str;
- arg_idx++;
- if (ge_str) {
- pda.pda_xpath[arg_idx] =
- "./ipv4-prefix-length-greater-or-equal";
- pda.pda_value[arg_idx] = ge_str;
- arg_idx++;
- }
- if (le_str) {
- pda.pda_xpath[arg_idx] =
- "./ipv4-prefix-length-lesser-or-equal";
- pda.pda_value[arg_idx] = le_str;
- arg_idx++;
- }
- } else {
- pda.pda_xpath[arg_idx] = "./ipv6-prefix";
- pda.pda_value[arg_idx] = prefix_str;
- arg_idx++;
- if (ge_str) {
- pda.pda_xpath[arg_idx] =
- "./ipv6-prefix-length-greater-or-equal";
- pda.pda_value[arg_idx] = ge_str;
- arg_idx++;
- }
- if (le_str) {
- pda.pda_xpath[arg_idx] =
- "./ipv6-prefix-length-lesser-or-equal";
- pda.pda_value[arg_idx] = le_str;
- arg_idx++;
- }
- }
+ if (prefix.p) {
+ prefix_copy(&pda.prefix, prefix);
+ apply_mask(&pda.prefix);
+ pda.ge = ge;
+ pda.le = le;
} else {
- pda.pda_xpath[0] = "./any";
- pda.pda_value[0] = "";
+ pda.any = true;
}
if (plist_is_dup(vty->candidate_config->dnode, &pda))
@@ -1298,7 +1266,6 @@ DEFPY_YANG(
"Maximum prefix length\n")
{
int64_t sseq;
- int arg_idx = 0;
struct plist_dup_args pda = {};
char xpath[XPATH_MAXLEN];
char xpath_entry[XPATH_MAXLEN + 128];
@@ -1312,24 +1279,11 @@ DEFPY_YANG(
pda.pda_name = name;
pda.pda_action = action;
if (prefix_str) {
- pda.pda_xpath[arg_idx] = "./ipv4-prefix";
- pda.pda_value[arg_idx] = prefix_str;
- arg_idx++;
- if (ge_str) {
- pda.pda_xpath[arg_idx] =
- "./ipv4-prefix-length-greater-or-equal";
- pda.pda_value[arg_idx] = ge_str;
- arg_idx++;
- }
- if (le_str) {
- pda.pda_xpath[arg_idx] =
- "./ipv4-prefix-length-lesser-or-equal";
- pda.pda_value[arg_idx] = le_str;
- arg_idx++;
- }
+ prefix_copy(&pda.prefix, prefix);
+ pda.ge = ge;
+ pda.le = le;
} else {
- pda.pda_xpath[0] = "./any";
- pda.pda_value[0] = "";
+ pda.any = true;
}
/* Duplicated entry without sequence, just quit. */
@@ -1408,8 +1362,8 @@ DEFPY_YANG(
"Maximum prefix length to be matched\n"
"Maximum prefix length\n")
{
- return plist_remove(vty, "ipv4", name, seq_str, action, prefix_str,
- ge_str, le_str);
+ return plist_remove(vty, "ipv4", name, seq_str, action,
+ prefix_str ? prefix : NULL, ge, le);
}
DEFPY_YANG(
@@ -1421,7 +1375,7 @@ DEFPY_YANG(
PREFIX_LIST_NAME_STR
ACCESS_LIST_SEQ_STR)
{
- return plist_remove(vty, "ipv4", name, seq_str, NULL, NULL, NULL, NULL);
+ return plist_remove(vty, "ipv4", name, seq_str, NULL, NULL, 0, 0);
}
DEFPY_YANG(
@@ -1516,7 +1470,6 @@ DEFPY_YANG(
"Minimum prefix length\n")
{
int64_t sseq;
- int arg_idx = 0;
struct plist_dup_args pda = {};
char xpath[XPATH_MAXLEN];
char xpath_entry[XPATH_MAXLEN + 128];
@@ -1530,24 +1483,11 @@ DEFPY_YANG(
pda.pda_name = name;
pda.pda_action = action;
if (prefix_str) {
- pda.pda_xpath[arg_idx] = "./ipv6-prefix";
- pda.pda_value[arg_idx] = prefix_str;
- arg_idx++;
- if (ge_str) {
- pda.pda_xpath[arg_idx] =
- "./ipv6-prefix-length-greater-or-equal";
- pda.pda_value[arg_idx] = ge_str;
- arg_idx++;
- }
- if (le_str) {
- pda.pda_xpath[arg_idx] =
- "./ipv6-prefix-length-lesser-or-equal";
- pda.pda_value[arg_idx] = le_str;
- arg_idx++;
- }
+ prefix_copy(&pda.prefix, prefix);
+ pda.ge = ge;
+ pda.le = le;
} else {
- pda.pda_xpath[0] = "./any";
- pda.pda_value[0] = "";
+ pda.any = true;
}
/* Duplicated entry without sequence, just quit. */
@@ -1626,8 +1566,8 @@ DEFPY_YANG(
"Minimum prefix length to be matched\n"
"Minimum prefix length\n")
{
- return plist_remove(vty, "ipv6", name, seq_str, action, prefix_str,
- ge_str, le_str);
+ return plist_remove(vty, "ipv6", name, seq_str, action,
+ prefix_str ? prefix : NULL, ge, le);
}
DEFPY_YANG(
@@ -1639,7 +1579,7 @@ DEFPY_YANG(
PREFIX_LIST_NAME_STR
ACCESS_LIST_SEQ_STR)
{
- return plist_remove(vty, "ipv6", name, seq_str, NULL, NULL, NULL, NULL);
+ return plist_remove(vty, "ipv6", name, seq_str, NULL, NULL, 0, 0);
}
DEFPY_YANG(
diff --git a/lib/filter_nb.c b/lib/filter_nb.c
index 85805ffa47c..80ea7a57cb2 100644
--- a/lib/filter_nb.c
+++ b/lib/filter_nb.c
@@ -387,10 +387,50 @@ static bool acl_zebra_is_dup(const struct lyd_node *dnode,
return acl_is_dup(entry_dnode, &ada);
}
+static void plist_dnode_to_prefix(const struct lyd_node *dnode, bool *any,
+ struct prefix *p, int *ge, int *le)
+{
+ *any = false;
+ *ge = 0;
+ *le = 0;
+
+ if (yang_dnode_exists(dnode, "./any")) {
+ *any = true;
+ return;
+ }
+
+ switch (yang_dnode_get_enum(dnode, "../type")) {
+ case YPLT_IPV4:
+ yang_dnode_get_prefix(p, dnode, "./ipv4-prefix");
+ if (yang_dnode_exists(dnode,
+ "./ipv4-prefix-length-greater-or-equal"))
+ *ge = yang_dnode_get_uint8(
+ dnode, "./ipv4-prefix-length-greater-or-equal");
+ if (yang_dnode_exists(dnode,
+ "./ipv4-prefix-length-lesser-or-equal"))
+ *le = yang_dnode_get_uint8(
+ dnode, "./ipv4-prefix-length-lesser-or-equal");
+ break;
+ case YPLT_IPV6:
+ yang_dnode_get_prefix(p, dnode, "./ipv6-prefix");
+ if (yang_dnode_exists(dnode,
+ "./ipv6-prefix-length-greater-or-equal"))
+ *ge = yang_dnode_get_uint8(
+ dnode, "./ipv6-prefix-length-greater-or-equal");
+ if (yang_dnode_exists(dnode,
+ "./ipv6-prefix-length-lesser-or-equal"))
+ *le = yang_dnode_get_uint8(
+ dnode, "./ipv6-prefix-length-lesser-or-equal");
+ break;
+ }
+}
+
static int _plist_is_dup(const struct lyd_node *dnode, void *arg)
{
struct plist_dup_args *pda = arg;
- int idx;
+ struct prefix p;
+ int ge, le;
+ bool any;
/* This entry is the caller, so skip it. */
if (pda->pda_entry_dnode
@@ -400,19 +440,14 @@ static int _plist_is_dup(const struct lyd_node *dnode, void *arg)
if (strcmp(yang_dnode_get_string(dnode, "action"), pda->pda_action))
return YANG_ITER_CONTINUE;
- /* Check if all values match. */
- for (idx = 0; idx < PDA_MAX_VALUES; idx++) {
- /* No more values. */
- if (pda->pda_xpath[idx] == NULL)
- break;
+ plist_dnode_to_prefix(dnode, &any, &p, &ge, &le);
- /* Not same type, just skip it. */
- if (!yang_dnode_exists(dnode, pda->pda_xpath[idx]))
+ if (pda->any) {
+ if (!any)
return YANG_ITER_CONTINUE;
-
- /* Check if different value. */
- if (strcmp(yang_dnode_get_string(dnode, pda->pda_xpath[idx]),
- pda->pda_value[idx]))
+ } else {
+ if (!prefix_same(&pda->prefix, &p) || pda->ge != ge
+ || pda->le != le)
return YANG_ITER_CONTINUE;
}
@@ -439,17 +474,6 @@ static bool plist_is_dup_nb(const struct lyd_node *dnode)
const struct lyd_node *entry_dnode =
yang_dnode_get_parent(dnode, "entry");
struct plist_dup_args pda = {};
- int idx = 0, arg_idx = 0;
- static const char *entries[] = {
- "./ipv4-prefix",
- "./ipv4-prefix-length-greater-or-equal",
- "./ipv4-prefix-length-lesser-or-equal",
- "./ipv6-prefix",
- "./ipv6-prefix-length-greater-or-equal",
- "./ipv6-prefix-length-lesser-or-equal",
- "./any",
- NULL
- };
/* Initialize. */
pda.pda_type = yang_dnode_get_string(entry_dnode, "../type");
@@ -457,19 +481,8 @@ static bool plist_is_dup_nb(const struct lyd_node *dnode)
pda.pda_action = yang_dnode_get_string(entry_dnode, "action");
pda.pda_entry_dnode = entry_dnode;
- /* Load all values/XPaths. */
- while (entries[idx] != NULL) {
- if (!yang_dnode_exists(entry_dnode, entries[idx])) {
- idx++;
- continue;
- }
-
- pda.pda_xpath[arg_idx] = entries[idx];
- pda.pda_value[arg_idx] =
- yang_dnode_get_string(entry_dnode, entries[idx]);
- arg_idx++;
- idx++;
- }
+ plist_dnode_to_prefix(entry_dnode, &pda.any, &pda.prefix, &pda.ge,
+ &pda.le);
return plist_is_dup(entry_dnode, &pda);
}

View File

@ -1,28 +0,0 @@
From 57e4c21583a9fa4c9d34fa8263930c3a1d5c6cd9 Mon Sep 17 00:00:00 2001
From: Igor Ryzhov <iryzhov@nfware.com>
Date: Tue, 31 Aug 2021 13:41:40 +0300
Subject: [PATCH] ospfd: correctly cleanup spf data
ospf_spf_cleanup frees the data so we need to reset the stale pointers.
Fixes #9523.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
---
ospfd/ospf_spf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 6a51440266e..8b4d55984c8 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -1781,6 +1781,9 @@ void ospf_spf_calculate_area(struct ospf *ospf, struct ospf_area *area,
ospf->ti_lfa_protection_type);
ospf_spf_cleanup(area->spf, area->spf_vertex_list);
+
+ area->spf = NULL;
+ area->spf_vertex_list = NULL;
}
void ospf_spf_calculate_areas(struct ospf *ospf, struct route_table *new_table,

View File

@ -0,0 +1,4 @@
#Type Name ID GECOS Home directory Shell
g frrvty -
u frr - "FRRouting routing suite" /var/run/frr /sbin/nologin
m frr frrvty

View File

@ -4,13 +4,14 @@
%define _legacy_common_support 1
Name: frr
Version: 8.0
Release: 5%{?checkout}%{?dist}
Version: 8.2.2
Release: 4%{?checkout}%{?dist}
Summary: Routing daemon
License: GPLv2+
URL: http://www.frrouting.org
Source0: https://github.com/FRRouting/frr/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-tmpfiles.conf
Source2: frr-sysusers.conf
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison >= 2.7
@ -55,11 +56,7 @@ Patch0000: 0000-remove-babeld-and-ldpd.patch
Patch0002: 0002-enable-openssl.patch
Patch0003: 0003-disable-eigrp-crypto.patch
Patch0004: 0004-fips-mode.patch
Patch0005: 0005-use-python3.patch
#Adding a patch from frr after rebase
#We would have hit this surely later, better apply the patch now
Patch0006: 0006-prefix-list-duplication.patch
Patch0007: 0007-ospf-opaque-lsa.patch
Patch0005: 0005-inactive-paths.patch
%description
FRRouting is free software that manages TCP/IP based routing protocols. It takes
@ -130,6 +127,8 @@ install -p -m 644 redhat/frr.logrotate %{buildroot}/etc/logrotate.d/frr
install -p -m 644 redhat/frr.pam %{buildroot}/etc/pam.d/frr
install -d -m 775 %{buildroot}/run/frr
install -p -D -m 0644 %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysusersdir}/frr.conf
# Delete libtool archives
find %{buildroot} -type f -name "*.la" -delete -print
@ -138,11 +137,8 @@ rm %{buildroot}%{_libdir}/frr/*.so
rm -r %{buildroot}%{_includedir}/frr/
%pre
getent group frrvty >/dev/null 2>&1 || groupadd -r frrvty >/dev/null 2>&1 || :
getent group frr >/dev/null 2>&1 || groupadd -r frr >/dev/null 2>&1 || :
getent passwd frr >/dev/null 2>&1 || useradd -M -r -g frr -s /sbin/nologin \
-c "FRRouting routing suite" -d %{_localstatedir}/run/frr frr || :
usermod -aG frrvty frr
%sysusers_create_compat %{SOURCE2}
exit 0
%post
%systemd_post frr.service
@ -209,8 +205,21 @@ make check PYTHON=%{__python3}
%dir /usr/share/yang
/usr/share/yang/*.yang
%{_tmpfilesdir}/%{name}.conf
%{_sysusersdir}/frr.conf
%changelog
* Tue Jun 14 2022 Michal Ruprich - 8.2.2-4
- Resolves: #2095404 - frr use systemd-sysusers
* Tue May 24 2022 Michal Ruprich <mruprich@redhat.com> - 8.2.2-3
- Resolves: #2081304 - Enhanced TMT testing for centos-stream
* Mon May 02 2022 Michal Ruprich <mruprich@redhat.com> - 8.2.2-2
- Resolves: #2069571 - the dynamic routing setup does not work any more
* Mon May 02 2022 Michal Ruprich <mruprich@redhat.com> - 8.2.2-1
- Resolves: #2069563 - Rebase frr to version 8.2.2
* Tue Nov 16 2021 Michal Ruprich <mruprich@redhat.com> - 8.0-5
- Resolves: #2023318 - Rebuilding for the new json-c library