From fde8af8d0b5634883393922079c3a688dcec9dd5 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Mon, 25 Nov 2019 00:45:24 -0500 Subject: [PATCH] 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 --- pbrd/pbr_zebra.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index b0a689a7e4..f0b0f8891a 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -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, -- 2.39.5