NULL the configuration item if no trust router is configured
authorAdam Bishop <adam@omega.org.uk>
Mon, 19 Sep 2016 14:47:20 +0000 (15:47 +0100)
committerAdam Bishop <adam@omega.org.uk>
Mon, 19 Sep 2016 15:51:52 +0000 (16:51 +0100)
Add a debug message so the user knows the dyanmic realm functionality is disabled

src/modules/rlm_realm/rlm_realm.c

index 24894ea..09f9f0f 100644 (file)
@@ -171,8 +171,11 @@ static int check_for_realm(void *instance, REQUEST *request, REALM **returnrealm
        /*
         *      Try querying for the dynamic realm.
         */
-       if (!realm && inst->trust_router)
+       if (!realm && inst->trust_router) {
                realm = tr_query_realm(request, realmname, inst->default_community, inst->rp_realm, inst->trust_router, inst->tr_port);
+       } else {
+               RDEBUG2("No trust router configured, skipping dynamic realm lookup");
+       }
 #endif
 
        if (!realm) {
@@ -384,6 +387,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
                if (!tr_init()) return -1;
        } else {
                rad_const_free(inst->trust_router);
+               inst->trust_router = NULL;
        }
 #endif