From 2b9dc841b7bc608c2dc5256604f6ef7e9f72fbfd Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 23 Jun 2022 11:14:46 -0400 Subject: [PATCH] zebra: Fix bug in netconf handling where dplane would drop the change When reading a on the fly change of an interested netconf netlink message. The ifindex and ns_id for the context was being set for the sub structure but not for the main context data structure and zebra_if_dplane_result was dropping the result on the floor because it was expecting the ns_id and the interface id to be in a different spot. Signed-off-by: Donald Sharp --- zebra/netconf_netlink.c | 4 ++-- zebra/zebra_dplane.c | 33 +-------------------------------- zebra/zebra_dplane.h | 5 ----- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/zebra/netconf_netlink.c b/zebra/netconf_netlink.c index 587f6c749e..03ddfdc525 100644 --- a/zebra/netconf_netlink.c +++ b/zebra/netconf_netlink.c @@ -53,8 +53,8 @@ static int netlink_netconf_dplane_update(ns_id_t ns_id, ifindex_t ifindex, ctx = dplane_ctx_alloc(); dplane_ctx_set_op(ctx, DPLANE_OP_INTF_NETCONFIG); - dplane_ctx_set_netconf_ns_id(ctx, ns_id); - dplane_ctx_set_netconf_ifindex(ctx, ifindex); + dplane_ctx_set_ns_id(ctx, ns_id); + dplane_ctx_set_ifindex(ctx, ifindex); dplane_ctx_set_netconf_mpls(ctx, mpls_on); dplane_ctx_set_netconf_mcast(ctx, mcast_on); diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index bb03d33e99..d464f4a4e6 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -301,8 +301,6 @@ struct dplane_gre_ctx { * info. The flags values are public, in the dplane.h file... */ struct dplane_netconf_info { - ns_id_t ns_id; - ifindex_t ifindex; enum dplane_netconf_status_e mpls_val; enum dplane_netconf_status_e mcast_val; }; @@ -2334,35 +2332,6 @@ dplane_ctx_neightable_get_mcast_probes(const struct zebra_dplane_ctx *ctx) return ctx->u.neightable.mcast_probes; } -ifindex_t dplane_ctx_get_netconf_ifindex(const struct zebra_dplane_ctx *ctx) -{ - DPLANE_CTX_VALID(ctx); - - return ctx->u.netconf.ifindex; -} - -ns_id_t dplane_ctx_get_netconf_ns_id(const struct zebra_dplane_ctx *ctx) -{ - DPLANE_CTX_VALID(ctx); - - return ctx->u.netconf.ns_id; -} - -void dplane_ctx_set_netconf_ifindex(struct zebra_dplane_ctx *ctx, - ifindex_t ifindex) -{ - DPLANE_CTX_VALID(ctx); - - ctx->u.netconf.ifindex = ifindex; -} - -void dplane_ctx_set_netconf_ns_id(struct zebra_dplane_ctx *ctx, ns_id_t ns_id) -{ - DPLANE_CTX_VALID(ctx); - - ctx->u.netconf.ns_id = ns_id; -} - enum dplane_netconf_status_e dplane_ctx_get_netconf_mpls(const struct zebra_dplane_ctx *ctx) { @@ -5439,7 +5408,7 @@ static void kernel_dplane_log_detail(struct zebra_dplane_ctx *ctx) case DPLANE_OP_INTF_NETCONFIG: zlog_debug("%s: ifindex %d, mpls %d, mcast %d", dplane_op2str(dplane_ctx_get_op(ctx)), - dplane_ctx_get_netconf_ifindex(ctx), + dplane_ctx_get_ifindex(ctx), dplane_ctx_get_netconf_mpls(ctx), dplane_ctx_get_netconf_mcast(ctx)); break; diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index 334d440a2f..7ba824c5c0 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -592,11 +592,6 @@ const struct zebra_l2info_gre * dplane_ctx_gre_get_info(const struct zebra_dplane_ctx *ctx); /* Interface netconf info */ -ifindex_t dplane_ctx_get_netconf_ifindex(const struct zebra_dplane_ctx *ctx); -ns_id_t dplane_ctx_get_netconf_ns_id(const struct zebra_dplane_ctx *ctx); -void dplane_ctx_set_netconf_ifindex(struct zebra_dplane_ctx *ctx, - ifindex_t ifindex); -void dplane_ctx_set_netconf_ns_id(struct zebra_dplane_ctx *ctx, ns_id_t ns_id); enum dplane_netconf_status_e dplane_ctx_get_netconf_mpls(const struct zebra_dplane_ctx *ctx); enum dplane_netconf_status_e -- 2.39.5