+1203. [func] Use "dataready" accept filter if available.
+
1302. [port] libbind: hpux 11.11 interface scaning.
1301. [func] Log zone when unable to get private keys to update
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: interfacemgr.c,v 1.66 2001/11/29 13:14:32 marka Exp $ */
+/* $Id: interfacemgr.c,v 1.67 2002/05/27 00:40:16 marka Exp $ */
#include <config.h>
goto tcp_listen_failure;
}
+ /*
+ * If/when there a multiple filters listen to the
+ * result.
+ */
+ (void)isc_socket_filter(ifp->tcpsocket, "dataready");
+
result = ns_clientmgr_createclients(ifp->clientmgr,
ifp->ntcptarget, ifp,
ISC_TRUE);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: msgs.h,v 1.6 2002/04/02 04:36:48 marka Exp $ */
+/* $Id: msgs.h,v 1.7 2002/05/27 00:40:18 marka Exp $ */
#ifndef ISC_MSGS_H
#define ISC_MSGS_H 1
#define ISC_MSG_ACCEPTRETURNED 1418 /* accept() returned %d/%s */
#define ISC_MSG_TOOMANYFDS 1419 /* %s: too many open file descriptors */
#define ISC_MSG_ZEROPORT 1420 /* dropping source port zero packet */
+#define ISC_MSG_FILTER 1420 /* setsockopt(SO_ACCEPTFILTER): %s */
#define ISC_MSG_AWAKE 1502 /* "awake" */
#define ISC_MSG_WORKING 1503 /* "working" */
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.h,v 1.55 2001/11/29 07:31:25 marka Exp $ */
+/* $Id: socket.h,v 1.56 2002/05/27 00:40:19 marka Exp $ */
#ifndef ISC_SOCKET_H
#define ISC_SOCKET_H 1
* ISC_R_UNEXPECTED
*/
+isc_result_t
+isc_socket_filter(isc_socket_t *sock, const char *filter);
+/*
+ * Inform the kernel that it should perform accept filtering.
+ * If filter is NULL the current filter will be removed.:w
+ */
+
isc_result_t
isc_socket_listen(isc_socket_t *sock, unsigned int backlog);
/*
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.c,v 1.225 2002/04/03 06:44:11 marka Exp $ */
+/* $Id: socket.c,v 1.226 2002/05/27 00:40:22 marka Exp $ */
#include <config.h>
return (ISC_R_SUCCESS);
}
+isc_result_t
+isc_socket_filter(isc_socket_t *sock, const char *filter) {
+#ifdef SO_ACCEPTFILTER
+ char strbuf[ISC_STRERRORSIZE];
+ struct accept_filter_arg afa;
+#else
+ UNUSED(sock);
+ UNUSED(filter);
+#endif
+
+ REQUIRE(VALID_SOCKET(sock));
+
+#ifdef SO_ACCEPTFILTER
+ bzero(&afa, sizeof(afa));
+ strncpy(afa.af_name, filter, sizeof(afa.af_name));
+ if (setsockopt(sock->fd, SOL_SOCKET, SO_ACCEPTFILTER,
+ &afa, sizeof(afa)) == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_FILTER, "setsockopt(SO_ACCEPTFILTER): %s",
+ strbuf);
+ return (ISC_R_FAILURE);
+ }
+ return (ISC_R_SUCCESS);
+#else
+ return (ISC_R_NOTIMPLEMENTED);
+#endif
+}
+
/*
* Set up to listen on a given socket. We do this by creating an internal
* event that will be dispatched when the socket has read activity. The
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.c,v 1.17 2002/04/02 04:36:52 marka Exp $ */
+/* $Id: socket.c,v 1.18 2002/05/27 00:40:23 marka Exp $ */
#define MAKE_EXTERNAL 1
#include <config.h>
return (ISC_R_SUCCESS);
}
+isc_result_t
+isc_socket_filter(isc_socket_t *sock, const char *filter) {
+ UNUSED(sock);
+ UNUSED(filter);
+
+ REQUIRE(VALID_SOCKET(sock));
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
/*
* Set up to listen on a given socket. We do this by creating an internal
* event that will be dispatched when the socket has read activity. The