Exposed realm_pool_add()
authorAlan T. DeKok <aland@freeradius.org>
Wed, 25 Jun 2014 16:13:05 +0000 (12:13 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 25 Jun 2014 16:13:05 +0000 (12:13 -0400)
For future work

src/main/realms.c

index 4f13f88..2d7b6ac 100644 (file)
@@ -840,6 +840,16 @@ static int pool_check_home_server(UNUSED realm_config_t *rc, CONF_PAIR *cp,
 }
 
 
+int realm_pool_add(home_pool_t *pool, UNUSED CONF_SECTION *cs)
+{
+       if (!rbtree_insert(home_pools_byname, pool)) {
+               rad_assert("Internal sanity check failed");
+               return 0;
+       }
+
+       return 1;
+}
+
 static int server_pool_add(realm_config_t *rc,
                           CONF_SECTION *cs, int server_type, int do_print)
 {
@@ -1010,6 +1020,8 @@ static int server_pool_add(realm_config_t *rc,
                cf_log_info(cs, "\tfallback = %s", pool->fallback->name);
        }
 
+       if (!realm_pool_add(pool, cs)) goto error;
+
        if (!rbtree_insert(home_pools_byname, pool)) {
                rad_assert("Internal sanity check failed");
                goto error;