Skip to content

Commit

Permalink
Decode attributes under more conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Dec 12, 2013
1 parent b44860d commit 72fc2e5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/main/radsniff.c
Expand Up @@ -1837,9 +1837,6 @@ int main(int argc, char *argv[])
conf->logger = rs_packet_print_fancy;
}

if (conf->filter_request_vps || conf->print_packet) {
conf->decode_attrs = true;
}
#if !defined(HAVE_PCAP_FOPEN_OFFLINE) || !defined(HAVE_PCAP_DUMP_FOPEN)
if (conf->from_stdin || conf->to_stdout) {
ERROR("PCAP streams not supported");
Expand Down Expand Up @@ -1917,6 +1914,18 @@ int main(int argc, char *argv[])
}
}

/*
* If we need to list attributes, link requests using attributes, filter attributes
* or print the packet contents, we need to decode the attributes.
*
* But, if were just logging requests, or graphing packet, we do not need to decode
* the packet attributes.
*/
if (conf->list_da || conf->link_da || conf->filter_response_vps || conf->filter_request_vps ||
conf->print_packet) {
conf->decode_attrs = true;
}

/*
* Setup the request tree
*/
Expand Down

0 comments on commit 72fc2e5

Please sign in to comment.