Don't use adminport when it is disabled

This commit is contained in:
manu 2005-07-12 14:15:39 +00:00
parent 4c94bccce3
commit e0dd78cfbd
3 changed files with 20 additions and 13 deletions

View File

@ -2,6 +2,8 @@
* src/racoon/pfkey.c: Set IKE ports to 0 in the SA when NAT-T is not
used.
* src/racoon/{admin.c|session.c}: Don't use adminport if it is
disabled.
2005-07-04 Emmanuel Dreyfus <manu@netbsd.org>

View File

@ -1,4 +1,4 @@
/* $NetBSD: admin.c,v 1.3 2005/05/08 08:57:26 manu Exp $ */
/* $NetBSD: admin.c,v 1.4 2005/07/12 14:15:39 manu Exp $ */
/* Id: admin.c,v 1.17 2005/01/02 08:39:09 manubsd Exp */
@ -572,8 +572,10 @@ admin2pfkey_proto(proto)
int
admin_init()
{
if (adminsock_path == NULL)
if (adminsock_path == NULL) {
lcconf->sock_admin = -1;
return 0;
}
memset(&sunaddr, 0, sizeof(sunaddr));
sunaddr.sun_family = AF_UNIX;

View File

@ -1,4 +1,4 @@
/* $NetBSD: session.c,v 1.1.1.2 2005/02/23 14:54:27 manu Exp $ */
/* $NetBSD: session.c,v 1.2 2005/07/12 14:15:39 manu Exp $ */
/* $KAME: session.c,v 1.32 2003/09/24 02:01:17 jinmei Exp $ */
@ -168,7 +168,8 @@ session(void)
}
#ifdef ENABLE_ADMINPORT
if (FD_ISSET(lcconf->sock_admin, &rfds))
if ((lcconf->sock_admin != -1) &&
(FD_ISSET(lcconf->sock_admin, &rfds)))
admin_handler();
#endif
@ -226,17 +227,19 @@ initfds()
FD_ZERO(&maskdying);
#ifdef ENABLE_ADMINPORT
if (lcconf->sock_admin >= FD_SETSIZE) {
plog(LLV_ERROR, LOCATION, NULL, "fd_set overrun\n");
exit(1);
}
FD_SET(lcconf->sock_admin, &mask0);
/* XXX should we listen on admin socket when dying ?
*/
if (lcconf->sock_admin != -1) {
if (lcconf->sock_admin >= FD_SETSIZE) {
plog(LLV_ERROR, LOCATION, NULL, "fd_set overrun\n");
exit(1);
}
FD_SET(lcconf->sock_admin, &mask0);
/* XXX should we listen on admin socket when dying ?
*/
#if 0
FD_SET(lcconf->sock_admin, &maskdying);
FD_SET(lcconf->sock_admin, &maskdying);
#endif
nfds = (nfds > lcconf->sock_admin ? nfds : lcconf->sock_admin);
nfds = (nfds > lcconf->sock_admin ? nfds : lcconf->sock_admin);
}
#endif
if (lcconf->sock_pfkey >= FD_SETSIZE) {
plog(LLV_ERROR, LOCATION, NULL, "fd_set overrun\n");