Fix strict_address to work again. The lists needs to be initialized
before configuration is read, which happens before my_addr_init() call.
This commit is contained in:
parent
4590553b36
commit
fab62310e7
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: grabmyaddr.c,v 1.21 2009/01/23 08:05:58 tteras Exp $ */
|
/* $NetBSD: grabmyaddr.c,v 1.22 2009/04/21 18:38:31 tteras Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||||
* Copyright (C) 2008 Timo Teras <timo.teras@iki.fi>.
|
* Copyright (C) 2008 Timo Teras <timo.teras@iki.fi>.
|
||||||
|
@ -288,13 +288,17 @@ myaddr_getsport(addr)
|
||||||
return bestmatch_port;
|
return bestmatch_port;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
myaddr_init()
|
myaddr_init_lists()
|
||||||
{
|
{
|
||||||
LIST_INIT(&configured);
|
LIST_INIT(&configured);
|
||||||
LIST_INIT(&opened);
|
LIST_INIT(&opened);
|
||||||
|
}
|
||||||
|
|
||||||
if (!lcconf->strict_address) {
|
int
|
||||||
|
myaddr_init()
|
||||||
|
{
|
||||||
|
if (!lcconf->strict_address) {
|
||||||
lcconf->rtsock = kernel_open_socket();
|
lcconf->rtsock = kernel_open_socket();
|
||||||
if (lcconf->rtsock < 0)
|
if (lcconf->rtsock < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: grabmyaddr.h,v 1.5 2008/12/23 14:03:12 tteras Exp $ */
|
/* $NetBSD: grabmyaddr.h,v 1.6 2009/04/21 18:38:32 tteras Exp $ */
|
||||||
|
|
||||||
/* Id: grabmyaddr.h,v 1.5 2004/06/11 16:00:16 ludvigm Exp */
|
/* Id: grabmyaddr.h,v 1.5 2004/06/11 16:00:16 ludvigm Exp */
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
#ifndef _GRABMYADDR_H
|
#ifndef _GRABMYADDR_H
|
||||||
#define _GRABMYADDR_H
|
#define _GRABMYADDR_H
|
||||||
|
|
||||||
|
extern void myaddr_init_lists __P((void));
|
||||||
extern int myaddr_init __P((void));
|
extern int myaddr_init __P((void));
|
||||||
extern void myaddr_close __P((void));
|
extern void myaddr_close __P((void));
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: session.c,v 1.24 2009/01/23 08:05:58 tteras Exp $ */
|
/* $NetBSD: session.c,v 1.25 2009/04/21 18:38:32 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 $ */
|
||||||
|
|
||||||
|
@ -193,6 +193,8 @@ session(void)
|
||||||
errx(1, "could not initialize radius config");
|
errx(1, "could not initialize radius config");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
myaddr_init_lists();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* in order to prefer the parameters by command line,
|
* in order to prefer the parameters by command line,
|
||||||
* saving some parameters before parsing configuration file.
|
* saving some parameters before parsing configuration file.
|
||||||
|
|
Loading…
Reference in New Issue