]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix parenting of dual homeservers
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 9 Sep 2014 19:25:47 +0000 (15:25 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 9 Sep 2014 19:51:00 +0000 (15:51 -0400)
src/include/realms.h
src/main/realms.c

index 97a2beb1f14c9e3444ca638aaa9d63ba407803fe..cf93e4372422692e41bb426bcb43f1dc2b111faf 100644 (file)
@@ -155,12 +155,14 @@ typedef struct _realm {
 #endif
 } REALM;
 
+typedef struct realm_config realm_config_t;
+
 int realms_init(CONF_SECTION *config);
 void realms_free(void);
 REALM *realm_find(char const *name); /* name is from a packet */
 REALM *realm_find2(char const *name); /* ... with name taken from realm_find */
 void realm_home_server_sanitize(home_server_t *home, CONF_SECTION *cs);
-int realm_home_server_add(home_server_t *home, CONF_SECTION *cs, int dual);
+int realm_home_server_add(realm_config_t *rc, home_server_t *home, CONF_SECTION *cs, int dual);
 int realm_pool_add(home_pool_t *pool, CONF_SECTION *cs);
 void realm_pool_free(home_pool_t *pool);
 int realm_realm_add( REALM *r, CONF_SECTION *cs);
index 876dbd0a7d0e4b4d46265085c12b440a0aed9487..03e3b57e511ee03cea418436f177c532446f43ce 100644 (file)
@@ -46,7 +46,7 @@ static realm_regex_t *realms_regex = NULL;
 
 #endif /* HAVE_REGEX */
 
-typedef struct realm_config_t {
+struct realm_config {
        CONF_SECTION    *cs;
        uint32_t        dead_time;
        uint32_t        retry_count;
@@ -54,7 +54,7 @@ typedef struct realm_config_t {
        bool            dynamic;
        bool            fallback;
        bool            wake_all_if_all_dead;
-} realm_config_t;
+};
 
 static realm_config_t *realm_config = NULL;
 static bool realms_initialized = false;
@@ -697,11 +697,10 @@ static int home_server_add(realm_config_t *rc, CONF_SECTION *cs)
 
        hs_srcipaddr = NULL;
 
-       return realm_home_server_add(home, cs, dual);
+       return realm_home_server_add(rc, home, cs, dual);
 }
 
-
-int realm_home_server_add(home_server_t *home, CONF_SECTION *cs, int dual)
+int realm_home_server_add(realm_config_t *rc, home_server_t *home, CONF_SECTION *cs, int dual)
 {
        const char *name2 = home->name;
 
@@ -767,7 +766,7 @@ int realm_home_server_add(home_server_t *home, CONF_SECTION *cs, int dual)
        realm_home_server_sanitize(home, cs);
 
        if (dual) {
-               home_server_t *home2 = talloc(home, home_server_t);
+               home_server_t *home2 = talloc(rc, home_server_t);
 
                memcpy(home2, home, sizeof(*home2));