if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
- else
+ 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;
+ }
protocol = ZEBRA_ROUTE_TABLE;
+ }
bgp_redist_add(bgp, AFI_IP, protocol, instance);
return bgp_redistribute_set(bgp, AFI_IP, protocol, instance, false);
if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
- else
+ 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;
+ }
protocol = ZEBRA_ROUTE_TABLE;
+ }
instance = strtoul(argv[idx_number]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP, protocol, instance);
if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
- else
+ 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;
+ }
protocol = ZEBRA_ROUTE_TABLE;
+ }
instance = strtoul(argv[idx_number]->arg, NULL, 10);
metric = strtoul(argv[idx_number_2]->arg, NULL, 10);
if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
- else
+ 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;
+ }
protocol = ZEBRA_ROUTE_TABLE;
+ }
instance = strtoul(argv[idx_number]->arg, NULL, 10);
metric = strtoul(argv[idx_number_2]->arg, NULL, 10);
if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
- else
+ 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;
+ }
protocol = ZEBRA_ROUTE_TABLE;
+ }
instance = strtoul(argv[idx_number]->arg, NULL, 10);
metric = strtoul(argv[idx_number_2]->arg, NULL, 10);
if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
- else
+ 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;
+ }
protocol = ZEBRA_ROUTE_TABLE;
+ }
instance = strtoul(argv[idx_number]->arg, NULL, 10);
bgp_redistribute_unset(bgp, AFI_IP, protocol, instance);