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

View File

@ -6,7 +6,7 @@
Name: frr
Version: 7.3
Release: 2%{?checkout}%{?dist}
Release: 3%{?checkout}%{?dist}
Summary: Routing daemon
License: GPLv2+
URL: http://www.frrouting.org
@ -177,6 +177,9 @@ make check PYTHON=%{__python3}
#%%{_libdir}/frr/frr/libyang_plugins/*
%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
- Add support for upcoming json-c 0.14.0