Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/dist/ipsec-tools Don't use adminport when it is disabled



details:   https://anonhg.NetBSD.org/src/rev/d299991efa1e
branches:  trunk
changeset: 582959:d299991efa1e
user:      manu <manu%NetBSD.org@localhost>
date:      Tue Jul 12 14:15:39 2005 +0000

description:
Don't use adminport when it is disabled

diffstat:

 crypto/dist/ipsec-tools/ChangeLog            |   2 ++
 crypto/dist/ipsec-tools/src/racoon/admin.c   |   6 ++++--
 crypto/dist/ipsec-tools/src/racoon/session.c |  27 +++++++++++++++------------
 3 files changed, 21 insertions(+), 14 deletions(-)

diffs (82 lines):

diff -r 57527d038d3b -r d299991efa1e crypto/dist/ipsec-tools/ChangeLog
--- a/crypto/dist/ipsec-tools/ChangeLog Tue Jul 12 14:14:46 2005 +0000
+++ b/crypto/dist/ipsec-tools/ChangeLog Tue Jul 12 14:15:39 2005 +0000
@@ -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@localhost>
 
diff -r 57527d038d3b -r d299991efa1e crypto/dist/ipsec-tools/src/racoon/admin.c
--- a/crypto/dist/ipsec-tools/src/racoon/admin.c        Tue Jul 12 14:14:46 2005 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/admin.c        Tue Jul 12 14:15:39 2005 +0000
@@ -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 @@
 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;
diff -r 57527d038d3b -r d299991efa1e crypto/dist/ipsec-tools/src/racoon/session.c
--- a/crypto/dist/ipsec-tools/src/racoon/session.c      Tue Jul 12 14:14:46 2005 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/session.c      Tue Jul 12 14:15:39 2005 +0000
@@ -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 @@
                }
 
 #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 @@
        FD_ZERO(&maskdying);
 
 #ifdef ENABLE_ADMINPORT
-       if (lcconf->sock_admin >= FD_SETSIZE) {
-               plog(LLV_ERROR, LOCATION, NULL, "fd_set overrun\n");
-               exit(1);
+       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);
+#endif
+               nfds = (nfds > lcconf->sock_admin ? nfds : lcconf->sock_admin);
        }
-       FD_SET(lcconf->sock_admin, &mask0);
-       /* XXX should we listen on admin socket when dying ?
-        */
-#if 0
-       FD_SET(lcconf->sock_admin, &maskdying);
-#endif
-       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");



Home | Main Index | Thread Index | Old Index