From: Alan T. DeKok Date: Thu, 31 Jul 2025 17:22:02 +0000 (-0400) Subject: use dictionary function to compare two attributes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42a21f07849fa02c4120f68b241e5ebb22406b27;p=thirdparty%2Ffreeradius-server.git use dictionary function to compare two attributes comparing by only the leaf attr was arguably wrong, as it ignored any depth or parenting. we use an fr_dict function to do the comparison. But that just compares the pointers, and isn't stable. Arguably that should be fixed, too. The fix depends on whether we want to just sort different attributes, or whether we want to order them. If we're just sorting them, then the current code is OK. --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 0f0443f7e6..8156fc35b2 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -837,7 +837,7 @@ int8_t fr_value_box_cmp(fr_value_box_t const *a, fr_value_box_t const *b) return -2; case FR_TYPE_ATTR: - return CMP(a->vb_attr, b->vb_attr); + return fr_dict_attr_cmp(a->vb_attr, b->vb_attr); /* * These should be handled at some point