summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_mplsvpn.h
diff options
context:
space:
mode:
authorG. Paul Ziemba <paulz@labn.net>2018-03-16 19:11:37 +0100
committerG. Paul Ziemba <paulz@labn.net>2018-03-20 06:13:43 +0100
commitb9c7bc5ab0ee57f4052b625c0e76663f50c1249f (patch)
tree72a2ec7ecf75be31dc6bf7db63ae29446e9d760e /bgpd/bgp_mplsvpn.h
parentMerge pull request #1885 from msablic/pim_mtrace_client (diff)
downloadfrr-b9c7bc5ab0ee57f4052b625c0e76663f50c1249f.tar.xz
frr-b9c7bc5ab0ee57f4052b625c0e76663f50c1249f.zip
bgpd: new vpn-policy CLI
PR #1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below. The code of this PR implements the vpn-specific parts of this syntax: router bgp <as> [vrf <FOO>] address-family <afi> unicast rd (vpn|evpn) export (AS:NN | IP:nn) label (vpn|evpn) export (0..1048575) rt (vpn|evpn) (import|export|both) RTLIST... nexthop vpn (import|export) (A.B.C.D | X:X::X:X) route-map (vpn|evpn|vrf NAME) (import|export) MAP [no] import|export [vpn|evpn|evpn8] [no] import|export vrf NAME User documentation of the vpn-specific parts of the above syntax is in PR #1937 Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Diffstat (limited to 'bgpd/bgp_mplsvpn.h')
-rw-r--r--bgpd/bgp_mplsvpn.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h
index d0ad8ac84..4d7a858be 100644
--- a/bgpd/bgp_mplsvpn.h
+++ b/bgpd/bgp_mplsvpn.h
@@ -107,11 +107,8 @@ static inline int vpn_leak_to_vpn_active(struct bgp *bgp_vrf, afi_t afi,
}
static inline int vpn_leak_from_vpn_active(struct bgp *bgp_vrf, afi_t afi,
- const char **pmsg,
- struct bgp_redist **pred)
+ const char **pmsg)
{
- struct bgp_redist *red;
-
if (bgp_vrf->inst_type != BGP_INSTANCE_TYPE_VRF
&& bgp_vrf->inst_type != BGP_INSTANCE_TYPE_DEFAULT) {
@@ -120,14 +117,11 @@ static inline int vpn_leak_from_vpn_active(struct bgp *bgp_vrf, afi_t afi,
return 0;
}
- /* Hijack zebra redist bits for this route type */
- red = bgp_redist_lookup(bgp_vrf, afi, ZEBRA_ROUTE_BGP_VPN, 0);
- if (red) {
- if (pred)
- *pred = red;
- } else {
+ /* Is vrf configured to import from vpn? */
+ if (!CHECK_FLAG(bgp_vrf->af_flags[afi][SAFI_UNICAST],
+ BGP_CONFIG_MPLSVPN_TO_VRF_IMPORT)) {
if (pmsg)
- *pmsg = "redist not set";
+ *pmsg = "import not set";
return 0;
}
if (!bgp_vrf->vpn_policy[afi].rtlist[BGP_VPN_POLICY_DIR_FROMVPN]) {