Skip to content

Commit

Permalink
Call map_cast_from_hex only for unknown attrs. Addresses #952
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Apr 10, 2015
1 parent 6b79ea1 commit 0c15725
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/map.c
Expand Up @@ -231,9 +231,11 @@ int map_afrom_cp(TALLOC_CTX *ctx, value_pair_map_t **out, CONF_PAIR *cp,
*/
type = cf_pair_value_type(cp);

if ((type == T_BARE_WORD) && (value[0] == '0') && (tolower((int)value[1] == 'x')) &&
map_cast_from_hex(map, type, value)) {
/* do nothing */
if ((map->lhs->type == TMPL_TYPE_ATTR) &&
map->lhs->tmpl_da->flags.is_unknown &&
!map_cast_from_hex(map, type, value)) {
goto error;

} else {
slen = tmpl_afrom_str(map, &map->rhs, value, strlen(value), type, src_request_def, src_list_def, true);
if (slen < 0) goto marker;
Expand Down

0 comments on commit 0c15725

Please sign in to comment.