pbrd: don't set rule removed on fail

Don't treat a remove failure as a successful remove.

This can cause us to get out of sync with the kernel.
Pbrd makes decisions on rule handling based on its installed
state so this needs to be as close to accurate as possible.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
Stephen Worley 2019-11-25 00:45:24 -05:00
parent e25ca4514f
commit fde8af8d0b

View File

@ -244,6 +244,11 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS)
__PRETTY_FUNCTION__, pbrms->installed);
break;
case ZAPI_RULE_FAIL_REMOVE:
/* Don't change state on rule removal failure */
DEBUGD(&pbr_dbg_zebra,
"%s: Received RULE_FAIL_REMOVED: %" PRIu64,
__PRETTY_FUNCTION__, pbrms->installed);
break;
case ZAPI_RULE_REMOVED:
pbrms->installed &= ~installed;
DEBUGD(&pbr_dbg_zebra, "%s: Received RULE REMOVED: %" PRIu64,