]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Add PREFIX_COPY
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 29 Aug 2017 22:21:52 +0000 (18:21 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 31 Aug 2017 17:40:35 +0000 (13:40 -0400)
Add a generic PREFIX_COPY to complement PREFIX_COPY_V4 and
PREFIX_COPY_V6

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/prefix.h

index a27f46ba0a4e223d65227a0494c8546824f649ae..823aed30c32f7650c8149be04824d2ee6a2eb6ee 100644 (file)
@@ -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 *);