]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pbrd: don't set rule removed on fail
authorStephen Worley <sworley@cumulusnetworks.com>
Mon, 25 Nov 2019 05:45:24 +0000 (00:45 -0500)
committerStephen Worley <sworley@cumulusnetworks.com>
Tue, 3 Dec 2019 20:56:00 +0000 (15:56 -0500)
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>
pbrd/pbr_zebra.c

index b0a689a7e4b428edeb3ba075e3bcce6cff5c9bb8..f0b0f8891a52d1daccbd69d42856e65338e83e61 100644 (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,