From: Alan T. DeKok Date: Wed, 17 Jun 2015 19:29:12 +0000 (-0400) Subject: Initialize the dictionaries via the same method as radclient X-Git-Tag: release_3_0_9~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5573a8a5071171f1e25ca9539aa1aa7136d52449;p=thirdparty%2Ffreeradius-server.git Initialize the dictionaries via the same method as radclient --- diff --git a/src/modules/proto_dhcp/dhcpclient.c b/src/modules/proto_dhcp/dhcpclient.c index a54836b02e7..6cad00bc062 100644 --- a/src/modules/proto_dhcp/dhcpclient.c +++ b/src/modules/proto_dhcp/dhcpclient.c @@ -466,10 +466,16 @@ int main(int argc, char **argv) tv_timeout.tv_sec = timeout; tv_timeout.tv_usec = ((timeout - (float) tv_timeout.tv_sec) * USEC); - if (dict_init(radius_dir, RADIUS_DICTIONARY) < 0) { - fr_perror("dhcpclient"); + if (dict_init(dict_dir, RADIUS_DICTIONARY) < 0) { + fr_perror("radclient"); + return 1; + } + + if (dict_read(radius_dir, RADIUS_DICTIONARY) < 0) { + fr_perror("radclient"); return 1; } + fr_strerror(); /* Clear the error buffer */ /* * Ensure that dictionary.dhcp is loaded. @@ -477,13 +483,7 @@ int main(int argc, char **argv) da = dict_attrbyname("DHCP-Message-Type"); if (!da) { if (dict_read(dict_dir, "dictionary.dhcp") < 0) { - fprintf(stderr, "Failed reading dictionary.dhcp: %s", - fr_strerror()); - return -1; - } - - if (dict_read(dict_dir, "dictionary.freeradius.internal") < 0) { - fprintf(stderr, "Failed reading dictionary.freeradius.internal: %s", + fprintf(stderr, "Failed reading dictionary.dhcp: %s\n", fr_strerror()); return -1; }