break;
}
+ /*
+ * Look up by name, *including* any Attr-1.2.3.4 which was created when
+ * parsing the configuration files.
+ */
vpt->tmpl_da = fr_dict_attr_by_name_substr(NULL, &p);
if (!vpt->tmpl_da) {
char const *q;
fr_strerror(); /* Clear out any existing errors */
+ /*
+ * At this point, the OID *must* be unknown, and
+ * not previously used.
+ */
slen = fr_dict_unknown_afrom_oid_substr(vpt, &vpt->tmpl_unknown,
fr_dict_root(fr_dict_internal), p);
/*
* Attr-1.2.3.4 is OK.
*/
if (slen > 0) {
- /*
- * Check what we just parsed really hasn't been defined
- * in the main dictionaries.
- *
- * If it has, parsing is the same as if the attribute
- * name had been used instead of its OID.
- */
- vpt->tmpl_da = fr_dict_attr_by_name(NULL, p);
- if (vpt->tmpl_da) {
- vpt->auto_converted = true;
- goto do_num;
- }
-
if (!allow_unknown) {
fr_strerror_printf("Unknown attribute");
slen = -(p - name);
*/
if ((map->lhs->type == TMPL_TYPE_ATTR) &&
(map->rhs->type == TMPL_TYPE_UNPARSED)) {
- /*
- * RHS is hex, try to parse it as
- * type-specific data.
- */
- if (map->lhs->auto_converted &&
- (map->rhs->name[0] == '0') && (map->rhs->name[1] == 'x') &&
- (map->rhs->len > 2) && ((map->rhs->len & 0x01) == 0)) {
- vpt = map->rhs;
- map->rhs = NULL;
-
- if (!map_cast_from_hex(map, T_BARE_WORD, vpt->name)) {
- map->rhs = vpt;
- cf_log_err(map->ci, "Cannot parse RHS hex as the data type of the attribute %s", map->lhs->tmpl_da->name);
- return -1;
- }
- talloc_free(vpt);
-
- } else if ((map->rhs->len > 0) ||
- (map->op != T_OP_CMP_EQ) ||
- (map->lhs->tmpl_da->type == PW_TYPE_STRING) ||
- (map->lhs->tmpl_da->type == PW_TYPE_OCTETS)) {
+ if ((map->rhs->len > 0) ||
+ (map->op != T_OP_CMP_EQ) ||
+ (map->lhs->tmpl_da->type == PW_TYPE_STRING) ||
+ (map->lhs->tmpl_da->type == PW_TYPE_OCTETS)) {
if (tmpl_cast_in_place(map->rhs, map->lhs->tmpl_da->type, map->lhs->tmpl_da) < 0) {
cf_log_err(map->ci, "Failed to parse data type %s from string: %s",
* ignore map->rhs.
*/
if ((map->lhs->type == TMPL_TYPE_ATTR) && (map->rhs->type == TMPL_TYPE_UNPARSED)) {
- /*
- * Convert it to the correct type.
- */
- if (map->lhs->auto_converted &&
- (map->rhs->name[0] == '0') && (map->rhs->name[1] == 'x') &&
- (map->rhs->len > 2) && ((map->rhs->len & 0x01) == 0)) {
- vp_tmpl_t *vpt = map->rhs;
- map->rhs = NULL;
-
- if (!map_cast_from_hex(map, T_BARE_WORD, vpt->name)) {
- map->rhs = vpt;
- cf_log_err(map->ci, "Cannot parse RHS hex as the data type of the attribute %s", map->lhs->tmpl_da->name);
- return -1;
- }
- talloc_free(vpt);
-
/*
* It's a literal string, just copy it.
* Don't escape anything.
*/
- } else if (tmpl_cast_in_place(map->rhs, map->lhs->tmpl_da->type, map->lhs->tmpl_da) < 0) {
+ if (tmpl_cast_in_place(map->rhs, map->lhs->tmpl_da->type, map->lhs->tmpl_da) < 0) {
cf_log_err(map->ci, "%s", fr_strerror());
return -1;
}