diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-08 10:16:12 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-08 10:34:31 -0400 | 
| commit | b03b88986e529eeb0cd7de1ce9a07d8d2a83b6d3 (patch) | |
| tree | c402bb8a37a4d02d0bdc71fd454eda541fbbb106 /lib/prefix.h | |
| parent | b34fd35d3ad5089ef2aecff06879d2f3ca471947 (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.h | 15 | 
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)));  };  | 
