]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_dplane.c
Merge pull request #5452 from mjstapp/fix_notify_nhg
[mirror_frr.git] / zebra / zebra_dplane.c
index 417c206467b1a79aeebd859e3aac5c5c8a72122e..bf1ba522a37fb6ead27900b5e5a34ec2f3bc37b7 100644 (file)
@@ -1023,6 +1023,11 @@ uint8_t dplane_ctx_get_old_distance(const struct zebra_dplane_ctx *ctx)
        return ctx->u.rinfo.zd_old_distance;
 }
 
+/*
+ * Set the nexthops associated with a context: note that processing code
+ * may well expect that nexthops are in canonical (sorted) order, so we
+ * will enforce that here.
+ */
 void dplane_ctx_set_nexthops(struct zebra_dplane_ctx *ctx, struct nexthop *nh)
 {
        DPLANE_CTX_VALID(ctx);
@@ -1031,7 +1036,7 @@ void dplane_ctx_set_nexthops(struct zebra_dplane_ctx *ctx, struct nexthop *nh)
                nexthops_free(ctx->u.rinfo.zd_ng.nexthop);
                ctx->u.rinfo.zd_ng.nexthop = NULL;
        }
-       copy_nexthops(&(ctx->u.rinfo.zd_ng.nexthop), nh, NULL);
+       nexthop_group_copy_nh_sorted(&(ctx->u.rinfo.zd_ng), nh);
 }
 
 const struct nexthop_group *dplane_ctx_get_ng(