From Roman Hoog Antink <rha@open.ch>: Clean up rmconf reloading: rename

the functions, and remove unneeded global variable.
This commit is contained in:
tteras 2011-01-28 13:00:14 +00:00
parent c54595ebf5
commit 5d9b9d50e9
3 changed files with 13 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: remoteconf.c,v 1.21 2010/09/08 12:18:35 vanhu Exp $ */ /* $NetBSD: remoteconf.c,v 1.22 2011/01/28 13:00:14 tteras Exp $ */
/* Id: remoteconf.c,v 1.38 2006/05/06 15:52:44 manubsd Exp */ /* Id: remoteconf.c,v 1.38 2006/05/06 15:52:44 manubsd Exp */
@ -79,7 +79,8 @@
#include "handler.h" #include "handler.h"
#include "genlist.h" #include "genlist.h"
static TAILQ_HEAD(_rmtree, remoteconf) rmtree, rmtree_save, rmtree_tmp; typedef TAILQ_HEAD(_rmtree, remoteconf) remoteconf_tailq_head_t;
static remoteconf_tailq_head_t rmtree, rmtree_save;
/* /*
* Script hook names and script hook paths * Script hook names and script hook paths
@ -744,15 +745,17 @@ initrmconf()
} }
void void
save_rmconf() rmconf_start_reload()
{ {
rmtree_save=rmtree; rmtree_save=rmtree;
initrmconf(); initrmconf();
} }
void void
save_rmconf_flush() rmconf_finish_reload()
{ {
remoteconf_tailq_head_t rmtree_tmp;
rmtree_tmp=rmtree; rmtree_tmp=rmtree;
rmtree=rmtree_save; rmtree=rmtree_save;
flushrmconf(); flushrmconf();

View File

@ -1,4 +1,4 @@
/* $NetBSD: remoteconf.h,v 1.12 2010/06/22 09:41:33 vanhu Exp $ */ /* $NetBSD: remoteconf.h,v 1.13 2011/01/28 13:00:14 tteras Exp $ */
/* Id: remoteconf.h,v 1.26 2006/05/06 15:52:44 manubsd Exp */ /* Id: remoteconf.h,v 1.26 2006/05/06 15:52:44 manubsd Exp */
@ -209,8 +209,8 @@ extern void insrmconf __P((struct remoteconf *));
extern void remrmconf __P((struct remoteconf *)); extern void remrmconf __P((struct remoteconf *));
extern void flushrmconf __P((void)); extern void flushrmconf __P((void));
extern void initrmconf __P((void)); extern void initrmconf __P((void));
extern void save_rmconf __P((void)); extern void rmconf_start_reload __P((void));
extern void save_rmconf_flush __P((void)); extern void rmconf_finish_reload __P((void));
extern int check_etypeok __P((struct remoteconf *, void *)); extern int check_etypeok __P((struct remoteconf *, void *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: session.c,v 1.28 2010/10/21 06:15:28 tteras Exp $ */ /* $NetBSD: session.c,v 1.29 2011/01/28 13:00:14 tteras Exp $ */
/* $KAME: session.c,v 1.32 2003/09/24 02:01:17 jinmei Exp $ */ /* $KAME: session.c,v 1.32 2003/09/24 02:01:17 jinmei Exp $ */
@ -391,8 +391,7 @@ static void reload_conf(){
/* TODO: save / restore / flush old lcconf (?) / rmtree /* TODO: save / restore / flush old lcconf (?) / rmtree
*/ */
save_rmconf(); rmconf_start_reload();
initrmconf();
#ifdef HAVE_LIBRADIUS #ifdef HAVE_LIBRADIUS
/* free and init radius configuration */ /* free and init radius configuration */
@ -431,7 +430,7 @@ static void reload_conf(){
*/ */
save_sainfotree_flush(); save_sainfotree_flush();
save_rmconf_flush(); rmconf_finish_reload();
} }
static void static void