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>
#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;
}