From: Alan T. DeKok Date: Thu, 2 Dec 2010 15:09:20 +0000 (+0100) Subject: Read the dictionaries if we're printing text output X-Git-Tag: release_2_1_11~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=355562e5586a19d0ff175d69b1dfd09637f897fa;p=thirdparty%2Ffreeradius-server.git Read the dictionaries if we're printing text output --- diff --git a/src/main/radsniff.c b/src/main/radsniff.c index 935d2ce39ef..4d9bacd13b0 100644 --- a/src/main/radsniff.c +++ b/src/main/radsniff.c @@ -318,6 +318,7 @@ static void NEVER_RETURNS usage(int status) fprintf(output, "\t-s secret\tRADIUS secret.\n"); fprintf(output, "\t-S\t\tSort attributes in the packet.\n"); fprintf(output, "\t\t\tUsed to compare server results.\n"); + fprintf(output, "\t-w file\tWrite output packets to file.\n"); fprintf(output, "\t-x\t\tPrint out debugging information.\n"); exit(status); } @@ -334,6 +335,7 @@ int main(int argc, char *argv[]) char *pcap_filter = NULL; char *radius_filter = NULL; char *filename = NULL; + int printable_output = 1; char *dump_file = NULL; int packet_count = -1; /* how many packets to sniff */ int opt; @@ -361,6 +363,7 @@ int main(int argc, char *argv[]) break; case 'F': filter_stdin = 1; + printable_output = 0; break; case 'f': pcap_filter = optarg; @@ -391,6 +394,7 @@ int main(int argc, char *argv[]) break; case 'w': dump_file = optarg; + printable_output = 0; break; case 'x': case 'X': /* for backwards compatibility */ @@ -420,9 +424,9 @@ int main(int argc, char *argv[]) } /* - * There are many times where we don't need the dictionaries. + * There are times when we don't need the dictionaries. */ - if (fr_debug_flag || radius_filter) { + if (printable_output) { if (dict_init(radius_dir, RADIUS_DICTIONARY) < 0) { fr_perror("radsniff"); return 1;