From: Arran Cudbard-Bell Date: Mon, 19 Mar 2018 14:23:32 +0000 (+0000) Subject: Both referencer and referencee must be TLVs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23ebbcffe6ea1df487d7c826efaef59824c69d96;p=thirdparty%2Ffreeradius-server.git Both referencer and referencee must be TLVs --- diff --git a/src/lib/util/dict.c b/src/lib/util/dict.c index ac3a20472d7..593198f97aa 100644 --- a/src/lib/util/dict.c +++ b/src/lib/util/dict.c @@ -1653,7 +1653,17 @@ static int dict_attr_ref_add(fr_dict_t *dict, fr_dict_attr_t const *parent, * or a TLV attribute. */ if (!ref->flags.is_root && (ref->type != FR_TYPE_TLV)) { - fr_strerror_printf("Referenced attribute \"%s\" is not a TLV", ref->name); + fr_strerror_printf("Referenced attribute \"%s\" is a '%s' not a 'tlv'", ref->name, + fr_int2str(dict_attr_types, ref->type, "")); + return -1; + } + + /* + * Reference must go from a TLV to a TLV + */ + if (type != FR_TYPE_TLV) { + fr_strerror_printf("Reference attribute must be of type TLV, not type '%s'", + fr_int2str(dict_attr_types, type, "")); return -1; }