summaryrefslogtreecommitdiff
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c83
1 files changed, 50 insertions, 33 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 98d9ffcceb..62f337a876 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -11548,7 +11548,7 @@ DEFUN (bgp_redistribute_ipv4,
}
bgp_redist_add(bgp, AFI_IP, type, 0);
- return bgp_redistribute_set(bgp, AFI_IP, type, 0);
+ return bgp_redistribute_set(bgp, AFI_IP, type, 0, false);
}
ALIAS_HIDDEN(
@@ -11569,6 +11569,7 @@ DEFUN (bgp_redistribute_ipv4_rmap,
int idx_word = 3;
int type;
struct bgp_redist *red;
+ bool changed;
type = proto_redistnum(AFI_IP, argv[idx_protocol]->text);
if (type < 0) {
@@ -11577,8 +11578,8 @@ DEFUN (bgp_redistribute_ipv4_rmap,
}
red = bgp_redist_add(bgp, AFI_IP, type, 0);
- bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
- return bgp_redistribute_set(bgp, AFI_IP, type, 0);
+ changed = bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
+ return bgp_redistribute_set(bgp, AFI_IP, type, 0, changed);
}
ALIAS_HIDDEN(
@@ -11602,6 +11603,7 @@ DEFUN (bgp_redistribute_ipv4_metric,
int type;
uint32_t metric;
struct bgp_redist *red;
+ bool changed;
type = proto_redistnum(AFI_IP, argv[idx_protocol]->text);
if (type < 0) {
@@ -11611,8 +11613,8 @@ DEFUN (bgp_redistribute_ipv4_metric,
metric = strtoul(argv[idx_number]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP, type, 0);
- bgp_redistribute_metric_set(bgp, red, AFI_IP, type, metric);
- return bgp_redistribute_set(bgp, AFI_IP, type, 0);
+ changed = bgp_redistribute_metric_set(bgp, red, AFI_IP, type, metric);
+ return bgp_redistribute_set(bgp, AFI_IP, type, 0, changed);
}
ALIAS_HIDDEN(
@@ -11639,6 +11641,7 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric,
int type;
uint32_t metric;
struct bgp_redist *red;
+ bool changed;
type = proto_redistnum(AFI_IP, argv[idx_protocol]->text);
if (type < 0) {
@@ -11648,9 +11651,9 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric,
metric = strtoul(argv[idx_number]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP, type, 0);
- bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
- bgp_redistribute_metric_set(bgp, red, AFI_IP, type, metric);
- return bgp_redistribute_set(bgp, AFI_IP, type, 0);
+ changed = bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
+ changed |= bgp_redistribute_metric_set(bgp, red, AFI_IP, type, metric);
+ return bgp_redistribute_set(bgp, AFI_IP, type, 0, changed);
}
ALIAS_HIDDEN(
@@ -11681,6 +11684,7 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap,
int type;
uint32_t metric;
struct bgp_redist *red;
+ bool changed;
type = proto_redistnum(AFI_IP, argv[idx_protocol]->text);
if (type < 0) {
@@ -11690,9 +11694,9 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap,
metric = strtoul(argv[idx_number]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP, type, 0);
- bgp_redistribute_metric_set(bgp, red, AFI_IP, type, metric);
- bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
- return bgp_redistribute_set(bgp, AFI_IP, type, 0);
+ changed = bgp_redistribute_metric_set(bgp, red, AFI_IP, type, metric);
+ changed |= bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
+ return bgp_redistribute_set(bgp, AFI_IP, type, 0, changed);
}
ALIAS_HIDDEN(
@@ -11728,7 +11732,7 @@ DEFUN (bgp_redistribute_ipv4_ospf,
protocol = ZEBRA_ROUTE_TABLE;
bgp_redist_add(bgp, AFI_IP, protocol, instance);
- return bgp_redistribute_set(bgp, AFI_IP, protocol, instance);
+ return bgp_redistribute_set(bgp, AFI_IP, protocol, instance, false);
}
ALIAS_HIDDEN(bgp_redistribute_ipv4_ospf, bgp_redistribute_ipv4_ospf_hidden_cmd,
@@ -11755,6 +11759,7 @@ DEFUN (bgp_redistribute_ipv4_ospf_rmap,
struct bgp_redist *red;
unsigned short instance;
int protocol;
+ bool changed;
if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
@@ -11763,8 +11768,8 @@ DEFUN (bgp_redistribute_ipv4_ospf_rmap,
instance = strtoul(argv[idx_number]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP, protocol, instance);
- bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
- return bgp_redistribute_set(bgp, AFI_IP, protocol, instance);
+ changed = bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
+ return bgp_redistribute_set(bgp, AFI_IP, protocol, instance, changed);
}
ALIAS_HIDDEN(bgp_redistribute_ipv4_ospf_rmap,
@@ -11795,6 +11800,7 @@ DEFUN (bgp_redistribute_ipv4_ospf_metric,
struct bgp_redist *red;
unsigned short instance;
int protocol;
+ bool changed;
if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
@@ -11805,8 +11811,9 @@ DEFUN (bgp_redistribute_ipv4_ospf_metric,
metric = strtoul(argv[idx_number_2]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP, protocol, instance);
- bgp_redistribute_metric_set(bgp, red, AFI_IP, protocol, metric);
- return bgp_redistribute_set(bgp, AFI_IP, protocol, instance);
+ changed = bgp_redistribute_metric_set(bgp, red, AFI_IP, protocol,
+ metric);
+ return bgp_redistribute_set(bgp, AFI_IP, protocol, instance, changed);
}
ALIAS_HIDDEN(bgp_redistribute_ipv4_ospf_metric,
@@ -11840,6 +11847,7 @@ DEFUN (bgp_redistribute_ipv4_ospf_rmap_metric,
struct bgp_redist *red;
unsigned short instance;
int protocol;
+ bool changed;
if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
@@ -11850,9 +11858,10 @@ DEFUN (bgp_redistribute_ipv4_ospf_rmap_metric,
metric = strtoul(argv[idx_number_2]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP, protocol, instance);
- bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
- bgp_redistribute_metric_set(bgp, red, AFI_IP, protocol, metric);
- return bgp_redistribute_set(bgp, AFI_IP, protocol, instance);
+ changed = bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
+ changed |= bgp_redistribute_metric_set(bgp, red, AFI_IP, protocol,
+ metric);
+ return bgp_redistribute_set(bgp, AFI_IP, protocol, instance, changed);
}
ALIAS_HIDDEN(
@@ -11889,6 +11898,7 @@ DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap,
struct bgp_redist *red;
unsigned short instance;
int protocol;
+ bool changed;
if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
protocol = ZEBRA_ROUTE_OSPF;
@@ -11899,9 +11909,10 @@ DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap,
metric = strtoul(argv[idx_number_2]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP, protocol, instance);
- bgp_redistribute_metric_set(bgp, red, AFI_IP, protocol, metric);
- bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
- return bgp_redistribute_set(bgp, AFI_IP, protocol, instance);
+ changed = bgp_redistribute_metric_set(bgp, red, AFI_IP, protocol,
+ metric);
+ changed |= bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
+ return bgp_redistribute_set(bgp, AFI_IP, protocol, instance, changed);
}
ALIAS_HIDDEN(
@@ -12009,7 +12020,7 @@ DEFUN (bgp_redistribute_ipv6,
}
bgp_redist_add(bgp, AFI_IP6, type, 0);
- return bgp_redistribute_set(bgp, AFI_IP6, type, 0);
+ return bgp_redistribute_set(bgp, AFI_IP6, type, 0, false);
}
DEFUN (bgp_redistribute_ipv6_rmap,
@@ -12025,6 +12036,7 @@ DEFUN (bgp_redistribute_ipv6_rmap,
int idx_word = 3;
int type;
struct bgp_redist *red;
+ bool changed;
type = proto_redistnum(AFI_IP6, argv[idx_protocol]->text);
if (type < 0) {
@@ -12033,8 +12045,8 @@ DEFUN (bgp_redistribute_ipv6_rmap,
}
red = bgp_redist_add(bgp, AFI_IP6, type, 0);
- bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
- return bgp_redistribute_set(bgp, AFI_IP6, type, 0);
+ changed = bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
+ return bgp_redistribute_set(bgp, AFI_IP6, type, 0, changed);
}
DEFUN (bgp_redistribute_ipv6_metric,
@@ -12051,6 +12063,7 @@ DEFUN (bgp_redistribute_ipv6_metric,
int type;
uint32_t metric;
struct bgp_redist *red;
+ bool changed;
type = proto_redistnum(AFI_IP6, argv[idx_protocol]->text);
if (type < 0) {
@@ -12060,8 +12073,8 @@ DEFUN (bgp_redistribute_ipv6_metric,
metric = strtoul(argv[idx_number]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP6, type, 0);
- bgp_redistribute_metric_set(bgp, red, AFI_IP6, type, metric);
- return bgp_redistribute_set(bgp, AFI_IP6, type, 0);
+ changed = bgp_redistribute_metric_set(bgp, red, AFI_IP6, type, metric);
+ return bgp_redistribute_set(bgp, AFI_IP6, type, 0, changed);
}
DEFUN (bgp_redistribute_ipv6_rmap_metric,
@@ -12081,6 +12094,7 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric,
int type;
uint32_t metric;
struct bgp_redist *red;
+ bool changed;
type = proto_redistnum(AFI_IP6, argv[idx_protocol]->text);
if (type < 0) {
@@ -12090,9 +12104,10 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric,
metric = strtoul(argv[idx_number]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP6, type, 0);
- bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
- bgp_redistribute_metric_set(bgp, red, AFI_IP6, type, metric);
- return bgp_redistribute_set(bgp, AFI_IP6, type, 0);
+ changed = bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
+ changed |= bgp_redistribute_metric_set(bgp, red, AFI_IP6, type,
+ metric);
+ return bgp_redistribute_set(bgp, AFI_IP6, type, 0, changed);
}
DEFUN (bgp_redistribute_ipv6_metric_rmap,
@@ -12112,6 +12127,7 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap,
int type;
uint32_t metric;
struct bgp_redist *red;
+ bool changed;
type = proto_redistnum(AFI_IP6, argv[idx_protocol]->text);
if (type < 0) {
@@ -12121,9 +12137,10 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap,
metric = strtoul(argv[idx_number]->arg, NULL, 10);
red = bgp_redist_add(bgp, AFI_IP6, type, 0);
- bgp_redistribute_metric_set(bgp, red, AFI_IP6, SAFI_UNICAST, metric);
- bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
- return bgp_redistribute_set(bgp, AFI_IP6, type, 0);
+ changed = bgp_redistribute_metric_set(bgp, red, AFI_IP6, SAFI_UNICAST,
+ metric);
+ changed |= bgp_redistribute_rmap_set(red, argv[idx_word]->arg);
+ return bgp_redistribute_set(bgp, AFI_IP6, type, 0, changed);
}
DEFUN (no_bgp_redistribute_ipv6,