vp->vp_tainted = true;
} else {
+ if (!ref) ref = fr_dict_root(dict_dhcpv6);
+
/*
* Child VPs go into the child group, not in the main parent list. BUT, we start
- * decoding attributes from the dictionary root, not from this parent.
+ * decoding attributes from the ref, and not from the group parent.
*/
- slen = fr_pair_tlvs_from_network(vp, &vp->vp_group, fr_dict_root(dict_dhcpv6), data, data_len, decode_ctx, decode_option, NULL, false);
+ slen = fr_pair_tlvs_from_network(vp, &vp->vp_group, ref, data, data_len, decode_ctx, decode_option, NULL, false);
if (slen < 0) goto raw_free;
}
if (!fr_pair_list_empty(&vp->vp_group)) {
(void) fr_pair_dcursor_child_iter_init(&child_cursor, &vp->vp_group, cursor);
+ /*
+ * @todo - encode from "ref" and not from the root? But that's hard,
+ * due to the whole proto stack thing, which we largely don't need
+ * any more.
+ */
while (fr_dcursor_current(&child_cursor) != NULL) {
slen = fr_dhcpv6_encode_option(&work_dbuff, &child_cursor, encode_ctx);
pair test-group = { child1 = 1 }
match test-group = { child1 = 1 }
-encode-pair test-group = { child1 = 1 }
-match 1a 9a 00 0c 1a 99 00 08 00 01 00 04 00 00 00 01
+#
+# This doesn't have Test-tlv encoded
+#
+decode-pair 1a 9a 00 08 00 01 00 04 00 00 00 01
+match test-group = { child1 = 1 }
#
-# Yeah, this is wrong. The decoder can only handle group refs which
-# point to the top of the tree.
+# However, this does encode Test-TLV, which is wrong.
+#
+encode-pair test-group = { child1 = 1 }
+match 1a 9a 00 0c 1a 99 00 08 00 01 00 04 00 00 00 01
+
#
-# @todo - fix it!
+# Sadly, there is no child 6809 of the group ref, so this decode
+# is all raw. :(
#
decode-pair -
-match test-group = { test-tlv = { child1 = 1 } }
+match test-group = { raw.6809 = 0x0001000400000001 }
count
-match 10
+match 12