From 72a1b201d3acc71a5cb4c7a06ed91ef30e21ee11 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 29 Aug 2017 18:21:52 -0400 Subject: [PATCH] lib: Add PREFIX_COPY Add a generic PREFIX_COPY to complement PREFIX_COPY_V4 and PREFIX_COPY_V6 Signed-off-by: Donald Sharp --- lib/prefix.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/prefix.h b/lib/prefix.h index a27f46ba0a..823aed30c3 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -315,7 +315,9 @@ extern void prefix_ipv4_free(struct prefix_ipv4 *); extern int str2prefix_ipv4(const char *, struct prefix_ipv4 *); extern void apply_mask_ipv4(struct prefix_ipv4 *); -#define PREFIX_COPY_IPV4(DST, SRC) \ +#define PREFIX_COPY(DST, SRC) \ + *((struct prefix *)(DST)) = *((const struct prefix *)(SRC)) +#define PREFIX_COPY_IPV4(DST, SRC) \ *((struct prefix_ipv4 *)(DST)) = *((const struct prefix_ipv4 *)(SRC)); extern int prefix_ipv4_any(const struct prefix_ipv4 *); -- 2.39.5