From: Alan T. DeKok Date: Thu, 10 Jun 2021 14:02:46 +0000 (-0400) Subject: fr_pair_afrom_num() no longer produces unknown da's X-Git-Tag: release_3_0_23~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9a45a1e18169290fa358243b390cb41bbf728f7;p=thirdparty%2Ffreeradius-server.git fr_pair_afrom_num() no longer produces unknown da's It is now only called from internal code, using hard-coded numbers. if the da does not exist, then the admin has edited the dictionaries and broken them. Instead of failing with an opaque error, just don't create the VP --- diff --git a/src/lib/pair.c b/src/lib/pair.c index 377ab22d41b..146c82f95b5 100644 --- a/src/lib/pair.c +++ b/src/lib/pair.c @@ -121,24 +121,7 @@ VALUE_PAIR *fr_pair_afrom_num(TALLOC_CTX *ctx, unsigned int attr, unsigned int v DICT_ATTR const *da; da = dict_attrbyvalue(attr, vendor); - if (!da) { - VALUE_PAIR *vp; - - vp = fr_pair_alloc(ctx); - if (!vp) return NULL; - - /* - * Ensure that the DA is parented by the VP. - */ - da = dict_unknown_afrom_fields(vp, attr, vendor); - if (!da) { - talloc_free(vp); - return NULL; - } - - vp->da = da; - return vp; - } + if (!da) return NULL; return fr_pair_afrom_da(ctx, da); }