Set "flags.is_tlv" correctly
authorAlan T. DeKok <aland@freeradius.org>
Wed, 16 Mar 2011 14:11:16 +0000 (15:11 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 16 Mar 2011 14:11:16 +0000 (15:11 +0100)
src/lib/dict.c
src/lib/radius.c

index 29cc260..1d5952d 100644 (file)
@@ -1108,7 +1108,6 @@ static int process_attribute(const char* fn, const int line,
                        return -1;
                }
 
-#if 0
                /*
                 *      Look up the REAL parent TLV.
                 */
@@ -1117,13 +1116,12 @@ static int process_attribute(const char* fn, const int line,
 
                        parent &= ~(fr_attr_mask[my_depth] << fr_attr_shift[my_depth]);
 
-                       da = dict_attrbyvalue(parent, block_);
+                       da = dict_attrbyvalue(parent, da->vendor);
                        if (!da) {
                                fr_strerror_printf("dict_init: %s[%d]: Parent attribute is undefined.", fn, line);
                                return -1;
                        }
                }
-#endif
                
                /*
                 *      Set which type of attribute this is.
index f6f1376..4b2c477 100644 (file)
@@ -783,7 +783,7 @@ static ssize_t vp2data_any(const RADIUS_PACKET *packet,
         */
        VP_TRACE("vp2data_any: %u attr %u -> %u\n",
                 nest, vp->attribute, vp->attribute >> fr_attr_shift[nest + 1]);
-       if ((nest < fr_attr_max_tlv) &&
+       if (vp->flags.is_tlv && (nest < fr_attr_max_tlv) &&
            ((vp->attribute >> fr_attr_shift[nest + 1]) != 0)) {
                return vp2data_tlvs(packet, original, secret, nest + 1, pvp,
                                    start, room);