]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Share route type checking macros 4321/head
authorStephen Worley <sworley@cumulusnetworks.com>
Mon, 13 May 2019 21:32:33 +0000 (14:32 -0700)
committerStephen Worley <sworley@cumulusnetworks.com>
Mon, 13 May 2019 23:47:18 +0000 (16:47 -0700)
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>
zebra/rib.h
zebra/rt.h

index 583c42682a4b5ab5a1e83302a0add5922a4cf5f7..c39abaffccdc0a4b6188848c4fd7c3771a5cd680 100644 (file)
@@ -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
index 08b51fcc0bcf4ba5fdf11df10bd030049c3b2637..04576671fe54f085409b4759a04a4ee8ecb0574f 100644 (file)
 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,