From ef57b70fa51687865e5823c0af2df2c6de338215 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Sun, 26 Mar 2017 19:20:15 +0200 Subject: BGP: Support for routes with mixed-AF next hops Covers IPv4/VPNv4 routes with IPv6 next hop (RFC 5549), IPv6 routes with IPv4 next hop (RFC 4798) and VPNv6 routes with IPv4 next hop (RFC 4659). Unfortunately it also makes next hop hooks more messy. Each BGP channel now could have two IGP tables, one for IPv4 next hops, the other for IPv6 next hops. --- proto/bgp/config.Y | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'proto/bgp/config.Y') diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y index e23c5b3b..1678256b 100644 --- a/proto/bgp/config.Y +++ b/proto/bgp/config.Y @@ -158,6 +158,7 @@ bgp_channel_start: bgp_afi BGP_CC->c.name = desc->name; BGP_CC->c.ra_mode = RA_UNDEF; BGP_CC->afi = $1; + BGP_CC->desc = desc; BGP_CC->gr_able = 0xff; /* undefined */ }; @@ -177,7 +178,12 @@ bgp_channel_item: | ADD PATHS RX { BGP_CC->add_path = BGP_ADD_PATH_RX; } | ADD PATHS TX { BGP_CC->add_path = BGP_ADD_PATH_TX; } | ADD PATHS bool { BGP_CC->add_path = $3 ? BGP_ADD_PATH_FULL : 0; } - | IGP TABLE rtable { BGP_CC->igp_table = $3; } + | IGP TABLE rtable { + if (bgp_cc_is_ipv4(BGP_CC)) BGP_CC->igp_table_ip4 = $3; + if (bgp_cc_is_ipv6(BGP_CC)) BGP_CC->igp_table_ip6 = $3; + } + | IGP TABLE IPV4 rtable { BGP_CC->igp_table_ip4 = $4; } + | IGP TABLE IPV6 rtable { BGP_CC->igp_table_ip6 = $4; } ; bgp_channel_opts: -- cgit v1.2.3