diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-02-16 11:00:01 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-02-16 18:33:55 +0100 |
commit | e2063df358308bf505db0561fbae344185e8bd8d (patch) | |
tree | 53f099c3d329e37a405552b4d78db18baca319ed /bgpd/rfapi/bgp_rfapi_cfg.c | |
parent | Merge pull request #1755 from donaldsharp/install_it_tar (diff) | |
download | frr-e2063df358308bf505db0561fbae344185e8bd8d.tar.xz frr-e2063df358308bf505db0561fbae344185e8bd8d.zip |
bgpd: prevent from configuring vrf-policy when in BGP VRF instance
Under a BGP VRF instance, prevent from entering in vrf-policy mode. This
mode is reserved for non VRF instances that want to handle several VRF
at the same time.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/rfapi/bgp_rfapi_cfg.c')
-rw-r--r-- | bgpd/rfapi/bgp_rfapi_cfg.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 15e09c639..f28b8a2ce 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -2977,6 +2977,11 @@ DEFUN_NOSH (vnc_vrf_policy, struct rfapi_nve_group_cfg *rfg; VTY_DECLVAR_CONTEXT(bgp, bgp); + if (bgp->inst_type == BGP_INSTANCE_TYPE_VRF) { + vty_out(vty, "Can't configure vrf-policy within a BGP VRF instance\n"); + return CMD_WARNING_CONFIG_FAILED; + } + /* Search for name */ rfg = bgp_rfapi_cfg_match_byname(bgp, argv[1]->arg, RFAPI_GROUP_CFG_VRF); @@ -3007,6 +3012,10 @@ DEFUN (vnc_no_vrf_policy, { VTY_DECLVAR_CONTEXT(bgp, bgp); + /* silently return */ + if (bgp->inst_type == BGP_INSTANCE_TYPE_VRF) + return CMD_SUCCESS; + return bgp_rfapi_delete_named_nve_group(vty, bgp, argv[2]->arg, RFAPI_GROUP_CFG_VRF); } |