summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2017-01-20 10:48:42 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2017-02-14 13:58:58 +0100
commita2dac1ef6a4f0dc3cc4e2bac83700119ff8b7459 (patch)
treebaa1e16fb6d81e445a8a97c76365226a128bf42b
parentbgpd: introduction of vxlan tunnel attribute (diff)
downloadfrr-a2dac1ef6a4f0dc3cc4e2bac83700119ff8b7459.tar.xz
frr-a2dac1ef6a4f0dc3cc4e2bac83700119ff8b7459.zip
bgpd: add EVPN RT5 gatewayIp address to bgp_static context
This field can be either IPv4 or IPv6 address and is filled in in bgp_static configuration structure. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
-rw-r--r--bgpd/bgp_route.c7
-rw-r--r--bgpd/bgp_route.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 8487284ed..f92447667 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -3993,6 +3993,7 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
#if ENABLE_BGP_VNC
u_int32_t label = 0;
#endif
+ union gw_addr add;
assert (bgp_static);
@@ -4006,7 +4007,11 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
if(afi == AFI_L2VPN)
{
- overlay_index_update(&attr, bgp_static->eth_s_id, NULL);
+ if (bgp_static->gatewayIp.family == AF_INET)
+ add.ipv4.s_addr = bgp_static->gatewayIp.u.prefix4.s_addr;
+ else if (bgp_static->gatewayIp.family == AF_INET6)
+ memcpy( &(add.ipv6), &(bgp_static->gatewayIp.u.prefix6), sizeof (struct in6_addr));
+ overlay_index_update(&attr, bgp_static->eth_s_id, &add);
if (bgp_static->encap_tunneltype == BGP_ENCAP_TYPE_VXLAN)
{
struct bgp_encap_type_vxlan bet;
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 20465fbf0..85a8cea86 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -208,6 +208,7 @@ struct bgp_static
struct eth_segment_id *eth_s_id;
char *router_mac;
uint16_t encap_tunneltype;
+ struct prefix gatewayIp;
};
#define BGP_NEXTHOP_AFI_FROM_NHLEN(nhlen) \