Update json-c-0.14 patch with a solution from upstream

This commit is contained in:
Björn Esser 2020-04-13 16:45:27 +02:00
parent fbca0aec49
commit 57c898887f
2 changed files with 34 additions and 39 deletions

View File

@ -1,39 +1,31 @@
From 7064b38fab818bac75364628682cee9e1c7219d9 Mon Sep 17 00:00:00 2001 diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org> index 5f4486b80..da57ffa83 100644
Date: Mon, 13 Apr 2020 13:28:51 +0200 --- a/bgpd/bgp_route.c
Subject: [PATCH] Add support for upcoming json-c 0.14.0. +++ b/bgpd/bgp_route.c
@@ -9922,7 +9922,7 @@ static int bgp_show_route_in_table(struct vty *vty, struct bgp *bgp,
TRUE/FALSE are not defined anymore. 1 and 0 are used instead. }
--- } else if (safi == SAFI_EVPN) {
lib/json.h | 15 +++++++++++++++ struct bgp_node *longest_pfx;
1 file changed, 15 insertions(+) - bool is_exact_pfxlen_match = FALSE;
+ bool is_exact_pfxlen_match = false;
diff --git a/lib/json.h b/lib/json.h
index c8866c524..5979b8077 100644
--- a/lib/json.h
+++ b/lib/json.h
@@ -28,6 +28,21 @@ extern "C" {
#include "command.h"
#include <json-c/json.h>
+/* for (rn = bgp_table_top(rib); rn; rn = bgp_route_next(rn)) {
+ * json-c 0.13.99 does not define TRUE/FALSE anymore if (prd && memcmp(rn->p.u.val, prd->val, 8) != 0)
+ * the json-c maintainers replaced them with pure 1/0 @@ -9932,7 +9932,7 @@ static int bgp_show_route_in_table(struct vty *vty, struct bgp *bgp,
+ * https://github.com/json-c/json-c/commit/0992aac61f8b continue;
+ */
+#if defined JSON_C_VERSION_NUM && \ longest_pfx = NULL;
+ JSON_C_VERSION_NUM >= ((0 << 16) | (13 << 8) | 99) - is_exact_pfxlen_match = FALSE;
+#ifndef FALSE + is_exact_pfxlen_match = false;
+#define FALSE 0 /*
+#endif * Search through all the prefixes for a match. The
+#ifndef TRUE * pfx's are enumerated in ascending order of pfxlens.
+#define TRUE 1 @@ -9951,7 +9951,7 @@ static int bgp_show_route_in_table(struct vty *vty, struct bgp *bgp,
+#endif int type5_pfxlen =
+#endif bgp_evpn_get_type5_prefixlen(&rm->p);
+ if (type5_pfxlen == match.prefixlen) {
/* - is_exact_pfxlen_match = TRUE;
* FRR style JSON iteration. + is_exact_pfxlen_match = true;
* Usage: JSON_FOREACH(...) { ... } bgp_unlock_node(rm);
-- break;
2.26.0 }

View File

@ -6,7 +6,7 @@
Name: frr Name: frr
Version: 7.3 Version: 7.3
Release: 2%{?checkout}%{?dist} Release: 3%{?checkout}%{?dist}
Summary: Routing daemon Summary: Routing daemon
License: GPLv2+ License: GPLv2+
URL: http://www.frrouting.org URL: http://www.frrouting.org
@ -177,6 +177,9 @@ make check PYTHON=%{__python3}
#%%{_libdir}/frr/frr/libyang_plugins/* #%%{_libdir}/frr/frr/libyang_plugins/*
%changelog %changelog
* Mon Apr 13 2020 Björn Esser <besser82@fedoraproject.org> - 7.3-3
- Update json-c-0.14 patch with a solution from upstream
* Mon Apr 13 2020 Björn Esser <besser82@fedoraproject.org> - 7.3-2 * Mon Apr 13 2020 Björn Esser <besser82@fedoraproject.org> - 7.3-2
- Add support for upcoming json-c 0.14.0 - Add support for upcoming json-c 0.14.0