diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-03-26 19:20:15 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-03-26 19:20:15 +0200 |
commit | ef57b70fa51687865e5823c0af2df2c6de338215 (patch) | |
tree | ab79f94a41470375b7826498aabb4b8e25bdfbff /proto/bgp/config.Y | |
parent | 01111fc42c461202d427260fb56807eac256e8d5 (diff) |
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.
Diffstat (limited to 'proto/bgp/config.Y')
-rw-r--r-- | proto/bgp/config.Y | 8 |
1 files changed, 7 insertions, 1 deletions
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: |