summaryrefslogtreecommitdiff
path: root/zebra/zebra_dplane.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@nvidia.com>2022-01-31 16:12:01 -0500
committerStephen Worley <sworley@nvidia.com>2022-03-09 18:02:44 -0500
commitab465d24bd864c7ab9f5841af89c108e03e768ac (patch)
tree922a88a2a82111b869059347bbe121ec6e169654 /zebra/zebra_dplane.c
parent97c726337389b7084ad970cf631a1126e5d5329c (diff)
zebra: only clear pd_reason on shutdown/sweep
Only clear protodown reason on shutdown/sweep, retain protodown state. This is to retain traditional and expected behavior with daemons like vrrpd setting protodown. They expet it to be set on shutdown and retained on bring up to prevent traffic from being dropped. We must cleanup our reason code though to prevent us from blocking others. Signed-off-by: Stephen Worley <sworley@nvidia.com>
Diffstat (limited to 'zebra/zebra_dplane.c')
-rw-r--r--zebra/zebra_dplane.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index 2d13b9b54b..1ad5d93ae2 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -192,9 +192,9 @@ struct dplane_intf_info {
uint32_t metric;
uint32_t flags;
- uint32_t r_bitfield;
bool protodown;
+ bool pd_reason_val;
#define DPLANE_INTF_CONNECTED (1 << 0) /* Connected peer, p2p */
#define DPLANE_INTF_SECONDARY (1 << 1)
@@ -1790,19 +1790,18 @@ void dplane_ctx_set_intf_metric(struct zebra_dplane_ctx *ctx, uint32_t metric)
ctx->u.intf.metric = metric;
}
-uint32_t dplane_ctx_get_intf_r_bitfield(const struct zebra_dplane_ctx *ctx)
+uint32_t dplane_ctx_get_intf_pd_reason_val(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
- return ctx->u.intf.r_bitfield;
+ return ctx->u.intf.pd_reason_val;
}
-void dplane_ctx_set_intf_r_bitfield(struct zebra_dplane_ctx *ctx,
- uint32_t r_bitfield)
+void dplane_ctx_set_intf_pd_reason_val(struct zebra_dplane_ctx *ctx, bool val)
{
DPLANE_CTX_VALID(ctx);
- ctx->u.intf.r_bitfield = r_bitfield;
+ ctx->u.intf.pd_reason_val = val;
}
bool dplane_ctx_intf_is_protodown(const struct zebra_dplane_ctx *ctx)
@@ -2721,7 +2720,9 @@ int dplane_ctx_intf_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
set_pdown = !!(zif->flags & ZIF_FLAG_SET_PROTODOWN);
unset_pdown = !!(zif->flags & ZIF_FLAG_UNSET_PROTODOWN);
- ctx->u.intf.r_bitfield = zif->protodown_rc;
+ if (zif->protodown_rc &&
+ ZEBRA_IF_IS_PROTODOWN_ONLY_EXTERNAL(zif) == false)
+ ctx->u.intf.pd_reason_val = true;
/*
* See if we have new protodown state to set, otherwise keep