diff options
Diffstat (limited to 'bgpd/bgp_vty.c')
| -rw-r--r-- | bgpd/bgp_vty.c | 53 | 
1 files changed, 12 insertions, 41 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 04b9ce5ea6..e18f6443b5 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -122,6 +122,9 @@ FRR_CFG_DEFAULT_BOOL(BGP_ENFORCE_FIRST_AS,  	{ .val_bool = false, .match_version = "< 9.1", },  	{ .val_bool = true },  ); +FRR_CFG_DEFAULT_BOOL(BGP_RR_ALLOW_OUTBOUND_POLICY, +	{ .val_bool = false }, +);  DEFINE_HOOK(bgp_inst_config_write,  		(struct bgp *bgp, struct vty *vty), @@ -622,6 +625,8 @@ int bgp_get_vty(struct bgp **bgp, as_t *as, const char *name,  				 BGP_FLAG_DYNAMIC_CAPABILITY);  		if (DFLT_BGP_ENFORCE_FIRST_AS)  			SET_FLAG((*bgp)->flags, BGP_FLAG_ENFORCE_FIRST_AS); +		if (DFLT_BGP_RR_ALLOW_OUTBOUND_POLICY) +			SET_FLAG((*bgp)->flags, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY);  		ret = BGP_SUCCESS;  	} @@ -17575,12 +17580,6 @@ DEFUN (bgp_redistribute_ipv4_ospf,  	if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)  		protocol = ZEBRA_ROUTE_OSPF;  	else { -		if (bgp->vrf_id != VRF_DEFAULT) { -			vty_out(vty, -				"%% Only default BGP instance can use '%s'\n", -				argv[idx_ospf_table]->arg); -			return CMD_WARNING_CONFIG_FAILED; -		}  		if (strncmp(argv[idx_ospf_table]->arg, "table-direct",  			    strlen("table-direct")) == 0) {  			protocol = ZEBRA_ROUTE_TABLE_DIRECT; @@ -17634,12 +17633,6 @@ DEFUN (bgp_redistribute_ipv4_ospf_rmap,  	if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)  		protocol = ZEBRA_ROUTE_OSPF;  	else { -		if (bgp->vrf_id != VRF_DEFAULT) { -			vty_out(vty, -				"%% Only default BGP instance can use '%s'\n", -				argv[idx_ospf_table]->arg); -			return CMD_WARNING_CONFIG_FAILED; -		}  		if (strncmp(argv[idx_ospf_table]->arg, "table-direct",  			    strlen("table-direct")) == 0) {  			protocol = ZEBRA_ROUTE_TABLE_DIRECT; @@ -17697,12 +17690,6 @@ DEFUN (bgp_redistribute_ipv4_ospf_metric,  	if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)  		protocol = ZEBRA_ROUTE_OSPF;  	else { -		if (bgp->vrf_id != VRF_DEFAULT) { -			vty_out(vty, -				"%% Only default BGP instance can use '%s'\n", -				argv[idx_ospf_table]->arg); -			return CMD_WARNING_CONFIG_FAILED; -		}  		if (strncmp(argv[idx_ospf_table]->arg, "table-direct",  			    strlen("table-direct")) == 0) {  			protocol = ZEBRA_ROUTE_TABLE_DIRECT; @@ -17767,12 +17754,6 @@ DEFUN (bgp_redistribute_ipv4_ospf_rmap_metric,  	if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)  		protocol = ZEBRA_ROUTE_OSPF;  	else { -		if (bgp->vrf_id != VRF_DEFAULT) { -			vty_out(vty, -				"%% Only default BGP instance can use '%s'\n", -				argv[idx_ospf_table]->arg); -			return CMD_WARNING_CONFIG_FAILED; -		}  		if (strncmp(argv[idx_ospf_table]->arg, "table-direct",  			    strlen("table-direct")) == 0) {  			protocol = ZEBRA_ROUTE_TABLE_DIRECT; @@ -17842,13 +17823,7 @@ DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap,  	if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)  		protocol = ZEBRA_ROUTE_OSPF;  	else { -		if (bgp->vrf_id != VRF_DEFAULT) { -			vty_out(vty, -				"%% Only default BGP instance can use '%s'\n", -				argv[idx_ospf_table]->arg); -			return CMD_WARNING_CONFIG_FAILED; -		} else if (strncmp(argv[idx_ospf_table]->arg, "table-direct", -				   strlen("table-direct")) == 0) { +		if (strncmp(argv[idx_ospf_table]->arg, "table-direct", strlen("table-direct")) == 0) {  			protocol = ZEBRA_ROUTE_TABLE_DIRECT;  			if (instance == RT_TABLE_MAIN ||  			    instance == RT_TABLE_LOCAL) { @@ -17911,12 +17886,6 @@ DEFUN (no_bgp_redistribute_ipv4_ospf,  	if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)  		protocol = ZEBRA_ROUTE_OSPF;  	else { -		if (bgp->vrf_id != VRF_DEFAULT) { -			vty_out(vty, -				"%% Only default BGP instance can use '%s'\n", -				argv[idx_ospf_table]->arg); -			return CMD_WARNING_CONFIG_FAILED; -		}  		if (strncmp(argv[idx_ospf_table]->arg, "table-direct",  			    strlen("table-direct")) == 0) {  			protocol = ZEBRA_ROUTE_TABLE_DIRECT; @@ -19816,10 +19785,12 @@ int bgp_config_write(struct vty *vty)  			}  		} -		if (CHECK_FLAG(bgp->flags, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY)) { -			vty_out(vty, -				" bgp route-reflector allow-outbound-policy\n"); -		} +		if (!!CHECK_FLAG(bgp->flags, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY) != +		    SAVE_BGP_RR_ALLOW_OUTBOUND_POLICY) +			vty_out(vty, " %sbgp route-reflector allow-outbound-policy\n", +				CHECK_FLAG(bgp->flags, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY) ? "" +											  : "no "); +  		if (CHECK_FLAG(bgp->flags, BGP_FLAG_COMPARE_ROUTER_ID))  			vty_out(vty, " bgp bestpath compare-routerid\n");  		if (CHECK_FLAG(bgp->flags, BGP_FLAG_COMPARE_AIGP))  | 
