]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix bug in netconf handling where dplane would drop the change
authorDonald Sharp <sharpd@nvidia.com>
Thu, 23 Jun 2022 15:14:46 +0000 (11:14 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 23 Jun 2022 15:23:08 +0000 (11:23 -0400)
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 <sharpd@nvidia.com>
zebra/netconf_netlink.c
zebra/zebra_dplane.c
zebra/zebra_dplane.h

index 587f6c749e1c695b679647f9fc85732354ca1fed..03ddfdc5251864c5129b6f6725d8137ac74b3e58 100644 (file)
@@ -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);
index bb03d33e990da534640863b81308b6e2b4f704d8..d464f4a4e6ed298186e59a3ab6e99fa209628531 100644 (file)
@@ -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;
index 334d440a2f43295f08a1bcadfbd7403d967a7b2b..7ba824c5c07ae5360aa1c28bd83c095a06736a63 100644 (file)
@@ -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