From: Alan T. DeKok Date: Sun, 6 Sep 2015 18:52:52 +0000 (-0400) Subject: Debug TLVs when encoding, too X-Git-Tag: release_3_0_10~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=771aac7c579c926720e7e4483570f273d2c95da7;p=thirdparty%2Ffreeradius-server.git Debug TLVs when encoding, too --- diff --git a/src/modules/proto_dhcp/dhcp.c b/src/modules/proto_dhcp/dhcp.c index 182c6527349..6b47dcff829 100644 --- a/src/modules/proto_dhcp/dhcp.c +++ b/src/modules/proto_dhcp/dhcp.c @@ -1295,6 +1295,7 @@ static ssize_t fr_dhcp_vp2data_tlv(uint8_t *out, ssize_t outlen, vp_cursor_t *cu return -1; } + debug_pair(vp); *opt_len += len; p += len; }; @@ -1356,6 +1357,7 @@ ssize_t fr_dhcp_encode_option(UNUSED TALLOC_CTX *ctx, uint8_t *out, size_t outle } else { len = fr_dhcp_vp2data(p, freespace, vp); + if (len >= 0) debug_pair(vp); fr_cursor_next(cursor); previous = vp->da; } @@ -1371,7 +1373,6 @@ ssize_t fr_dhcp_encode_option(UNUSED TALLOC_CTX *ctx, uint8_t *out, size_t outle p += len; *opt_len += len; freespace -= len; - debug_pair(vp); } while ((vp = fr_cursor_current(cursor)) && previous && (previous == vp->da) && vp->da->flags.array); @@ -1671,7 +1672,6 @@ int fr_dhcp_encode(RADIUS_PACKET *packet) p[2] = packet->code - PW_DHCP_OFFSET; p += 3; - /* * Pre-sort attributes into contiguous blocks so that fr_dhcp_encode_option * operates correctly. This changes the order of the list, but never mind...