summaryrefslogtreecommitdiff
path: root/lib/prefix.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-08-08 10:16:12 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-08-08 10:34:31 -0400
commitb03b88986e529eeb0cd7de1ce9a07d8d2a83b6d3 (patch)
treec402bb8a37a4d02d0bdc71fd454eda541fbbb106 /lib/prefix.h
parentb34fd35d3ad5089ef2aecff06879d2f3ca471947 (diff)
lib, bgpd: Distinguish between AF_EVPN and AF_ETHERNET
Create AF_EVPN for internal use and start using it. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index f665f55dfd..3ebf615468 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -116,7 +116,18 @@ struct evpn_addr {
#endif
#endif
-/* IPv4 and IPv6 unified prefix structure. */
+/* The 'family' in the prefix structure is internal to FRR and need not
+ * map to standard OS AF_ definitions except where needed for interacting
+ * with the kernel. However, AF_ definitions are currently in use and
+ * prevalent across the code. Define a new FRR-specific AF for EVPN to
+ * distinguish between 'ethernet' (MAC-only) and 'evpn' prefixes and
+ * ensure it does not conflict with any OS AF_ definition.
+ */
+#if !defined(AF_EVPN)
+#define AF_EVPN (AF_MAX + 1)
+#endif
+
+/* FRR generic prefix structure. */
struct prefix {
u_char family;
u_char prefixlen;
@@ -131,7 +142,7 @@ struct prefix {
struct ethaddr prefix_eth; /* AF_ETHERNET */
u_char val[8];
uintptr_t ptr;
- struct evpn_addr prefix_evpn;
+ struct evpn_addr prefix_evpn; /* AF_EVPN */
} u __attribute__((aligned(8)));
};