summaryrefslogtreecommitdiffstats
path: root/pbrd/pbr_zebra.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-12-18 22:11:39 +0100
committerStephen Worley <sworley@cumulusnetworks.com>2020-04-09 19:45:14 +0200
commitf143cffac2a3cfef96b9d6d796673ecc7c545f8f (patch)
treea601256b0902e7fbd3a5b841b73ebadfde78c3c8 /pbrd/pbr_zebra.c
parentpbrd: free nexthop_group name on `no set nexthop-group` (diff)
downloadfrr-f143cffac2a3cfef96b9d6d796673ecc7c545f8f.tar.xz
frr-f143cffac2a3cfef96b9d6d796673ecc7c545f8f.zip
pbrd: implement `set *` and `match *` config replacement
Implement the ability to replace any existing `set *` or `match` with another one or adding more config without having to first delete the original config already there. Before, we needed to constantly execute a `no` command for everything to remove the rule before making changes to it. With this patch, you can replace configs on individual sequences much easier. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'pbrd/pbr_zebra.c')
-rw-r--r--pbrd/pbr_zebra.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index cb28015c1..4178ad580 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -548,7 +548,7 @@ static void pbr_encode_pbr_map_sequence(struct stream *s,
}
void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
- struct pbr_map_interface *pmi, bool install)
+ struct pbr_map_interface *pmi, bool install, bool changed)
{
struct pbr_map *pbrm = pbrms->parent;
struct stream *s;
@@ -560,11 +560,13 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
pbrm->name, install, is_installed);
/*
- * If we are installed and asked to do so again
- * just return. If we are not installed and asked
+ * If we are installed and asked to do so again and the config
+ * has not changed, just return.
+ *
+ * If we are not installed and asked
* and asked to delete just return;
*/
- if (install && is_installed)
+ if (install && is_installed && !changed)
return;
if (!install && !is_installed)