summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-11-25 21:16:35 +0100
committerStephen Worley <sworley@cumulusnetworks.com>2019-12-03 21:56:00 +0100
commit46b0382056881b346624d340d8d835de742f18fd (patch)
tree7216d184952df22d6cb68e625372ecc73352400a /pbrd
parentpbrd: don't silently fail on atomic match IP change attempts (diff)
downloadfrr-46b0382056881b346624d340d8d835de742f18fd.tar.xz
frr-46b0382056881b346624d340d8d835de742f18fd.zip
pbrd: don't silently fail on atomic match MARK change attempts
Also don't silently fail when we attempt to atomically change a match MARK to a new one. We would overwrite the frist one but never actually install it. Change it to explicitly fail if a config is already present for now. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_vty.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c
index 5bc94a2b3..24d3c0fd1 100644
--- a/pbrd/pbr_vty.c
+++ b/pbrd/pbr_vty.c
@@ -189,9 +189,14 @@ DEFPY(pbr_map_match_mark, pbr_map_match_mark_cmd,
#endif
if (!no) {
- if (pbrms->mark == (uint32_t) mark)
+ if (pbrms->mark && pbrms->mark == (uint32_t)mark)
return CMD_SUCCESS;
- pbrms->mark = (uint32_t) mark;
+ else if (pbrms->mark) {
+ vty_out(vty,
+ "A `match mark XX` command already exists, please remove that first\n");
+ return CMD_WARNING_CONFIG_FAILED;
+ } else
+ pbrms->mark = (uint32_t)mark;
} else {
pbrms->mark = 0;
}