]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Initialize the dictionaries via the same method as radclient
authorAlan T. DeKok <aland@freeradius.org>
Wed, 17 Jun 2015 19:29:12 +0000 (15:29 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 17 Jun 2015 19:29:12 +0000 (15:29 -0400)
src/modules/proto_dhcp/dhcpclient.c

index a54836b02e7f9ab3ccbfb17f3dbde478d56197c6..6cad00bc0624a4d2887b8df12da8735adeca59da 100644 (file)
@@ -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;
                }