Skip to content

Commit

Permalink
Output added DHCP options using rdebug_pair
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed May 7, 2015
1 parent c68f04f commit b8999a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/modules/proto_dhcp/dhcp.c
Expand Up @@ -1027,12 +1027,6 @@ ssize_t fr_dhcp_decode_options(TALLOC_CTX *ctx, VALUE_PAIR **out, uint8_t const
return -1;
}
fr_cursor_merge(&cursor, vp);

for (vp = fr_cursor_current(&cursor);
vp;
vp = fr_cursor_next(&cursor)) {
debug_pair(vp);
}
a_p += a_len;
} /* loop over array entries */
next:
Expand Down Expand Up @@ -1161,12 +1155,20 @@ int fr_dhcp_decode(RADIUS_PACKET *packet)
*/
{
VALUE_PAIR *options = NULL;
vp_cursor_t options_cursor;

if (fr_dhcp_decode_options(packet, &options, packet->data + 240, packet->data_len - 240) < 0) {
return -1;
}

if (options) fr_cursor_merge(&cursor, options);
if (options) {
for (vp = fr_cursor_init(&options_cursor, options);
vp;
vp = fr_cursor_next(&options_cursor)) {
debug_pair(vp);
}
fr_cursor_merge(&cursor, options);
}
}

/*
Expand Down
1 change: 1 addition & 0 deletions src/modules/proto_dhcp/rlm_dhcp.c
Expand Up @@ -93,6 +93,7 @@ static ssize_t dhcp_options_xlat(UNUSED void *instance, REQUEST *request,
for (vp = fr_cursor_init(&cursor, &head);
vp;
vp = fr_cursor_next(&cursor)) {
rdebug_pair(L_DBG_LVL_2, request, vp, "dhcp_options: ");
decoded++;
}

Expand Down

0 comments on commit b8999a2

Please sign in to comment.