summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-05-13 23:32:33 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-05-14 01:47:18 +0200
commit66cb184575b6ca492ee11610b0564e91962089d7 (patch)
treed2569a81c1c7e9fa9a2fa0b659f4b930b35c7f69 /zebra
parentzebra: Make RIB_SYSTEM|KERNEL_ROUTE a property of rib.h (diff)
downloadfrr-66cb184575b6ca492ee11610b0564e91962089d7.tar.xz
frr-66cb184575b6ca492ee11610b0564e91962089d7.zip
zebra: Share route type checking macros
Make the RIB_*_ROUTE() macro which is passed a route in rib.h just use the R*_ROUTE() macros that directly check the type in rt.h. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/rib.h5
-rw-r--r--zebra/rt.h6
2 files changed, 6 insertions, 5 deletions
diff --git a/zebra/rib.h b/zebra/rib.h
index 583c42682..c39abaffc 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -148,10 +148,9 @@ struct route_entry {
uint32_t dplane_sequence;
};
-#define RIB_SYSTEM_ROUTE(R) \
- ((R)->type == ZEBRA_ROUTE_KERNEL || (R)->type == ZEBRA_ROUTE_CONNECT)
+#define RIB_SYSTEM_ROUTE(R) RSYSTEM_ROUTE((R)->type)
-#define RIB_KERNEL_ROUTE(R) ((R)->type == ZEBRA_ROUTE_KERNEL)
+#define RIB_KERNEL_ROUTE(R) RKERNEL_ROUTE((R)->type)
/* meta-queue structure:
* sub-queue 0: connected, kernel
diff --git a/zebra/rt.h b/zebra/rt.h
index 08b51fcc0..04576671f 100644
--- a/zebra/rt.h
+++ b/zebra/rt.h
@@ -35,8 +35,10 @@
extern "C" {
#endif
-#define RSYSTEM_ROUTE(type) \
- ((type) == ZEBRA_ROUTE_KERNEL || (type) == ZEBRA_ROUTE_CONNECT)
+#define RKERNEL_ROUTE(type) ((type) == ZEBRA_ROUTE_KERNEL)
+
+#define RSYSTEM_ROUTE(type) \
+ ((RKERNEL_ROUTE(type)) || (type) == ZEBRA_ROUTE_CONNECT)
/*
* Update or delete a route, LSP, or pseudowire from the kernel,