pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/bind914 net/bind914: fix runtime problem



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5e228a2396cb
branches:  trunk
changeset: 397017:5e228a2396cb
user:      taca <taca%pkgsrc.org@localhost>
date:      Fri Jun 14 16:14:05 2019 +0000

description:
net/bind914: fix runtime problem

Fix runtime problem by removing extra (fdwatch)  from NetBSD current.

Bump PKGREVISION.

diffstat:

 net/bind914/Makefile                                   |    3 +-
 net/bind914/distinfo                                   |    6 +-
 net/bind914/options.mk                                 |    4 +-
 net/bind914/patches/patch-lib_isc_include_isc_socket.h |   99 ----
 net/bind914/patches/patch-lib_isc_include_isc_types.h  |   18 -
 net/bind914/patches/patch-lib_isc_unix_socket.c        |  369 +----------------
 6 files changed, 7 insertions(+), 492 deletions(-)

diffs (truncated from 554 to 300 lines):

diff -r 81d10abccd3e -r 5e228a2396cb net/bind914/Makefile
--- a/net/bind914/Makefile      Fri Jun 14 16:05:25 2019 +0000
+++ b/net/bind914/Makefile      Fri Jun 14 16:14:05 2019 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.4 2019/05/20 16:31:08 taca Exp $
+# $NetBSD: Makefile,v 1.5 2019/06/14 16:14:05 taca Exp $
 
 DISTNAME=      bind-${BIND_VERSION}
 PKGNAME=       ${DISTNAME:S/-P/pl/}
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  ftp://ftp.isc.org/isc/bind9/${BIND_VERSION}/
 
diff -r 81d10abccd3e -r 5e228a2396cb net/bind914/distinfo
--- a/net/bind914/distinfo      Fri Jun 14 16:05:25 2019 +0000
+++ b/net/bind914/distinfo      Fri Jun 14 16:14:05 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2019/05/20 16:31:08 taca Exp $
+$NetBSD: distinfo,v 1.4 2019/06/14 16:14:05 taca Exp $
 
 SHA1 (bind-9.14.2.tar.gz) = b46c8713804cb8de43ded17cfb852d2db8e184d9
 RMD160 (bind-9.14.2.tar.gz) = 74d9d8d29515aa7d57e9d986d6e4b0f8af6b7962
@@ -34,9 +34,7 @@
 SHA1 (patch-lib_dns_validator.c) = 7d7471efe5109f5b2d6f9e99fe15fa314fdd217d
 SHA1 (patch-lib_dns_view.c) = 25095827adbc75dc629b0f435dbd711b599c86c9
 SHA1 (patch-lib_isc_backtrace.c) = 5fa1dd0f18ae757233d9cc21e36a5f6a84990db1
-SHA1 (patch-lib_isc_include_isc_socket.h) = 956beab8ea6a1a004b1d1682600ead6863ba05c9
-SHA1 (patch-lib_isc_include_isc_types.h) = 985874069eee13504da4dca020d6fc964e8a1f83
 SHA1 (patch-lib_isc_rwlock.c) = 7eb832915528d00e616b6c7503ec346143946876
 SHA1 (patch-lib_isc_stats.c) = 0dde2b7cbde80f608e52bf8136b3af227b65ba4b
-SHA1 (patch-lib_isc_unix_socket.c) = 8f6ac08539fb4c9b3eb1aa5fe4c3811f010aa87b
+SHA1 (patch-lib_isc_unix_socket.c) = 4f7be1616bac7263069292f909896373f0e6fab8
 SHA1 (patch-lib_isc_unix_time.c) = 04312e043601688aa2b0a09dad1bcb51d9273e9d
diff -r 81d10abccd3e -r 5e228a2396cb net/bind914/options.mk
--- a/net/bind914/options.mk    Fri Jun 14 16:05:25 2019 +0000
+++ b/net/bind914/options.mk    Fri Jun 14 16:14:05 2019 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: options.mk,v 1.1 2019/04/30 03:34:34 taca Exp $
+# $NetBSD: options.mk,v 1.2 2019/06/14 16:14:05 taca Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.bind914
 PKG_SUPPORTED_OPTIONS= bind-dig-sigchase bind-xml-statistics-server
 PKG_SUPPORTED_OPTIONS+=        bind-json-statistics-server blacklist
 PKG_SUPPORTED_OPTIONS+=        threads readline mysql pgsql ldap dlz-filesystem
-PKG_SUPPORTED_OPTIONS+=        geoip pkcs11 tuning dnstap
+PKG_SUPPORTED_OPTIONS+=        geoip tuning dnstap # pkcs11
 PKG_SUGGESTED_OPTIONS+=        readline
 
 PLIST_VARS+=   dnstap pkcs11
diff -r 81d10abccd3e -r 5e228a2396cb net/bind914/patches/patch-lib_isc_include_isc_socket.h
--- a/net/bind914/patches/patch-lib_isc_include_isc_socket.h    Fri Jun 14 16:05:25 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-$NetBSD: patch-lib_isc_include_isc_socket.h,v 1.1 2019/04/30 03:34:34 taca Exp $
-
-* fdwatch change from NetBSD base.
-
---- lib/isc/include/isc/socket.h.orig  2019-04-06 20:09:59.000000000 +0000
-+++ lib/isc/include/isc/socket.h
-@@ -243,7 +243,8 @@ typedef enum {
-       isc_sockettype_udp = 1,
-       isc_sockettype_tcp = 2,
-       isc_sockettype_unix = 3,
--      isc_sockettype_raw = 4
-+      isc_sockettype_raw = 4,
-+      isc_sockettype_fdwatch = 5
- } isc_sockettype_t;
- 
- /*@{*/
-@@ -1037,6 +1038,82 @@ isc_socketmgr_renderjson(isc_socketmgr_t
-  */
- typedef isc_result_t
- (*isc_socketmgrcreatefunc_t)(isc_mem_t *mctx, isc_socketmgr_t **managerp);
-+/*!
-+ * Flags for fdwatchcreate.
-+ */
-+#define ISC_SOCKFDWATCH_READ  0x00000001      /*%< watch for readable */
-+#define ISC_SOCKFDWATCH_WRITE 0x00000002      /*%< watch for writable */
-+/*@}*/
-+
-+isc_result_t
-+isc_socket_fdwatchcreate(isc_socketmgr_t *manager,
-+                       int fd,
-+                       int flags,
-+                       isc_sockfdwatch_t callback,
-+                       void *cbarg,
-+                       isc_task_t *task,
-+                       isc_socket_t **socketp);
-+/*%<
-+ * Create a new file descriptor watch socket managed by 'manager'.
-+ *
-+ * Note:
-+ *
-+ *\li   'fd' is the already-opened file descriptor (must be less
-+ *    than maxsockets).
-+ *\li This function is not available on Windows.
-+ *\li The callback function is called "in-line" - this means the function
-+ *    needs to return as fast as possible, as all other I/O will be suspended
-+ *    until the callback completes.
-+ *
-+ * Requires:
-+ *
-+ *\li 'manager' is a valid manager
-+ *
-+ *\li 'socketp' is a valid pointer, and *socketp == NULL
-+ *
-+ *\li 'fd' be opened.
-+ *
-+ * Ensures:
-+ *
-+ *    '*socketp' is attached to the newly created fdwatch socket
-+ *
-+ * Returns:
-+ *
-+ *\li #ISC_R_SUCCESS
-+ *\li #ISC_R_NOMEMORY
-+ *\li #ISC_R_NORESOURCES
-+ *\li #ISC_R_UNEXPECTED
-+ *\li #ISC_R_RANGE
-+ */
-+
-+isc_result_t
-+isc_socket_fdwatchpoke(isc_socket_t *sock,
-+                     int flags);
-+/*%<
-+ * Poke a file descriptor watch socket informing the manager that it
-+ * should restart watching the socket
-+ *
-+ * Note:
-+ *
-+ *\li   'sock' is the socket returned by isc_socket_fdwatchcreate
-+ *
-+ *\li   'flags' indicates what the manager should watch for on the socket
-+ *      in addition to what it may already be watching.  It can be one or
-+ *      both of ISC_SOCKFDWATCH_READ and ISC_SOCKFDWATCH_WRITE.  To
-+ *      temporarily disable watching on a socket the value indicating
-+ *      no more data should be returned from the call back routine.
-+ *
-+ *\li This function is not available on Windows.
-+ *
-+ * Requires:
-+ *
-+ *\li 'sock' is a valid isc socket
-+ *
-+ *
-+ * Returns:
-+ *
-+ *\li #ISC_R_SUCCESS
-+ */
- 
- ISC_LANG_ENDDECLS
- 
diff -r 81d10abccd3e -r 5e228a2396cb net/bind914/patches/patch-lib_isc_include_isc_types.h
--- a/net/bind914/patches/patch-lib_isc_include_isc_types.h     Fri Jun 14 16:05:25 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-$NetBSD: patch-lib_isc_include_isc_types.h,v 1.1 2019/04/30 03:34:34 taca Exp $
-
-* Changes change from NetBSD base.
-
---- lib/isc/include/isc/types.h.orig   2019-04-06 20:09:59.000000000 +0000
-+++ lib/isc/include/isc/types.h
-@@ -65,7 +65,11 @@ typedef struct isc_ratelimiter              isc_rate
- typedef struct isc_region             isc_region_t;           /*%< Region */
- typedef uint64_t                      isc_resourcevalue_t;    /*%< Resource Value */
- typedef unsigned int                  isc_result_t;           /*%< Result */
-+#ifndef ISC_PLATFORM_USE_NATIVE_RWLOCKS
- typedef struct isc_rwlock             isc_rwlock_t;           /*%< Read Write Lock */
-+#else
-+typedef pthread_rwlock_t              isc_rwlock_t;           /*%< Read Write Lock */
-+#endif
- typedef struct isc_sockaddr           isc_sockaddr_t;         /*%< Socket Address */
- typedef ISC_LIST(isc_sockaddr_t)      isc_sockaddrlist_t;     /*%< Socket Address List */
- typedef struct isc_socket             isc_socket_t;           /*%< Socket */
diff -r 81d10abccd3e -r 5e228a2396cb net/bind914/patches/patch-lib_isc_unix_socket.c
--- a/net/bind914/patches/patch-lib_isc_unix_socket.c   Fri Jun 14 16:05:25 2019 +0000
+++ b/net/bind914/patches/patch-lib_isc_unix_socket.c   Fri Jun 14 16:14:05 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-lib_isc_unix_socket.c,v 1.1 2019/04/30 03:34:34 taca Exp $
+$NetBSD: patch-lib_isc_unix_socket.c,v 1.2 2019/06/14 16:14:05 taca Exp $
 
 * Apply fixes from NetBSD base system.
 
@@ -12,370 +12,3 @@
                         (e) == 0)
  
  #define DLVL(x) ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(x)
-@@ -366,6 +367,10 @@ struct isc__socket {
-       unsigned char           overflow; /* used for MSG_TRUNC fake */
- #endif
- 
-+      void                    *fdwatcharg;
-+      isc_sockfdwatch_t       fdwatchcb;
-+      int                     fdwatchflags;
-+      isc_task_t              *fdwatchtask;
-       unsigned int            dscp;
- };
- 
-@@ -452,10 +457,14 @@ static void free_socket(isc__socket_t **
- static isc_result_t allocate_socket(isc__socketmgr_t *, isc_sockettype_t,
-                                   isc__socket_t **);
- static void destroy(isc__socket_t **);
-+#if 0
- static void internal_accept(isc__socket_t *);
-+#endif
- static void internal_connect(isc__socket_t *);
- static void internal_recv(isc__socket_t *);
- static void internal_send(isc__socket_t *);
-+static void internal_fdwatch_write(isc__socket_t *);
-+static void internal_fdwatch_read(isc__socket_t *);
- static void process_cmsg(isc__socket_t *, struct msghdr *, isc_socketevent_t *);
- static void build_msghdr_send(isc__socket_t *, char *, isc_socketevent_t *,
-                             struct msghdr *, struct iovec *, size_t *);
-@@ -1576,6 +1585,7 @@ doio_recv(isc__socket_t *sock, isc_socke
-       case isc_sockettype_udp:
-       case isc_sockettype_raw:
-               break;
-+      case isc_sockettype_fdwatch:
-       default:
-               INSIST(0);
-               ISC_UNREACHABLE();
-@@ -1778,9 +1788,26 @@ socketclose(isc__socketthread_t *thread,
-        */
-       LOCK(&thread->fdlock[lockid]);
-       thread->fds[fd] = NULL;
--      thread->fdstate[fd] = CLOSE_PENDING;
-+      if (sock->type == isc_sockettype_fdwatch)
-+              thread->fdstate[fd] = CLOSED;
-+      else
-+              thread->fdstate[fd] = CLOSE_PENDING;
-       UNLOCK(&thread->fdlock[lockid]);
--      select_poke(thread->manager, thread->threadid, fd, SELECT_POKE_CLOSE);
-+      if (sock->type == isc_sockettype_fdwatch) {
-+              /*
-+               * The caller may close the socket once this function returns,
-+               * and `fd' may be reassigned for a new socket.  So we do
-+               * unwatch_fd() here, rather than defer it via select_poke().
-+               * Note: this may complicate data protection among threads and
-+               * may reduce performance due to additional locks.  One way to
-+               * solve this would be to dup() the watched descriptor, but we
-+               * take a simpler approach at this moment.
-+               */
-+              (void)unwatch_fd(thread, fd, SELECT_POKE_READ);
-+              (void)unwatch_fd(thread, fd, SELECT_POKE_WRITE);
-+      } else
-+              select_poke(thread->manager, thread->threadid, fd,
-+                  SELECT_POKE_CLOSE);
- 
-       inc_stats(thread->manager->stats, sock->statsindex[STATID_CLOSE]);
-       if (sock->active == 1) {
-@@ -2187,6 +2214,13 @@ opensocket(isc__socketmgr_t *manager, is
-                       }
- #endif
-                       break;
-+              case isc_sockettype_fdwatch:
-+                      /*
-+                       * We should not be called for isc_sockettype_fdwatch
-+                       * sockets.
-+                       */
-+                      INSIST(0);
-+                      break;
-               }
-       } else {
-               sock->fd = dup(dup_socket->fd);
-@@ -2485,6 +2519,7 @@ socket_create(isc_socketmgr_t *manager0,
- 
-       REQUIRE(VALID_MANAGER(manager));
-       REQUIRE(socketp != NULL && *socketp == NULL);
-+      REQUIRE(type != isc_sockettype_fdwatch);
- 
-       result = allocate_socket(manager, type, &sock);
-       if (result != ISC_R_SUCCESS)
-@@ -2605,6 +2640,7 @@ isc_socket_open(isc_socket_t *sock0) {
-        */
-       REQUIRE(sock->fd == -1);
-       REQUIRE(sock->threadid == -1);
-+      REQUIRE(sock->type != isc_sockettype_fdwatch);
- 
-       result = opensocket(sock->manager, sock, NULL);
-       if (result != ISC_R_SUCCESS) {
-@@ -2684,6 +2720,7 @@ isc_socket_close(isc_socket_t *sock0) {
- 
-       LOCK(&sock->lock);
- 
-+      REQUIRE(sock->type != isc_sockettype_fdwatch);
-       REQUIRE(sock->fd >= 0 && sock->fd < (int)sock->manager->maxsocks);
- 
-       INSIST(!sock->connecting);
-@@ -2714,6 +2751,24 @@ isc_socket_close(isc_socket_t *sock0) {
-       return (ISC_R_SUCCESS);
- }
- 
-+static void
-+dispatch_recv(isc__socket_t *sock) {
-+      if (sock->type != isc_sockettype_fdwatch) {
-+              internal_recv(sock);
-+      } else {
-+              internal_fdwatch_read(sock);
-+      }
-+}



Home | Main Index | Thread Index | Old Index