]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
always call protocol-specific decode_value, if we have it
authorAlan T. DeKok <aland@freeradius.org>
Thu, 21 Nov 2019 13:31:24 +0000 (08:31 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 21 Nov 2019 13:31:42 +0000 (08:31 -0500)
src/lib/util/struct.c

index 306ed6d2aee020c415f31375b0b79507665db007..8dfcb2a696107a77912be102492a30493f572cd4 100644 (file)
@@ -192,7 +192,7 @@ ssize_t fr_struct_from_network(TALLOC_CTX *ctx, fr_cursor_t *cursor,
                 *      Note that if this is an *array* of DNS labels,
                 *      the callback should deal with this.
                 */
-               if (decode_value && !child->flags.extra && child->flags.subtype) {
+               if (decode_value) {
                        ssize_t slen;
 
                        slen = decode_value(ctx, &child_cursor, NULL, child, p, child_length, decoder_ctx);
@@ -200,6 +200,7 @@ ssize_t fr_struct_from_network(TALLOC_CTX *ctx, fr_cursor_t *cursor,
 
                        p += slen;      /* not always the same as child->flags.length */
                        child_num++;    /* go to the next child */
+                       if (da_is_key_field(child)) key_vp = fr_cursor_tail(&child_cursor);
                        continue;
                }
 
@@ -301,7 +302,7 @@ ssize_t fr_struct_from_network(TALLOC_CTX *ctx, fr_cursor_t *cursor,
                if (child->type == FR_TYPE_STRUCT) {
                        slen = fr_struct_from_network(ctx, &child_cursor, child, p, end - p, child_p,
                                decode_value, decoder_ctx);
-                       if (slen < 0) goto unknown_child;
+                       if (slen <= 0) goto unknown_child;
                        p += slen;
 
                } else {