2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Remove message catalogs

This commit is contained in:
Ondřej Surý
2018-11-23 21:35:01 +01:00
parent f8965a5588
commit e2cdf066ea
67 changed files with 306 additions and 1760 deletions

View File

@@ -45,7 +45,6 @@
#include <isc/list.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/msgs.h>
#include <isc/mutex.h>
#include <isc/net.h>
#include <isc/once.h>
@@ -627,12 +626,10 @@ thread_log(isc__socketthread_t *thread,
static void
socket_log(isc__socket_t *sock, const isc_sockaddr_t *address,
isc_logcategory_t *category, isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int message,
const char *fmt, ...) ISC_FORMAT_PRINTF(9, 10);
const char *fmt, ...) ISC_FORMAT_PRINTF(6, 7);
static void
socket_log(isc__socket_t *sock, const isc_sockaddr_t *address,
isc_logcategory_t *category, isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int message,
const char *fmt, ...)
{
char msgbuf[2048];
@@ -647,14 +644,12 @@ socket_log(isc__socket_t *sock, const isc_sockaddr_t *address,
va_end(ap);
if (address == NULL) {
isc_log_iwrite(isc_lctx, category, module, level,
msgcat, msgset, message,
"socket %p: %s", sock, msgbuf);
isc_log_write(isc_lctx, category, module, level,
"socket %p: %s", sock, msgbuf);
} else {
isc_sockaddr_format(address, peerbuf, sizeof(peerbuf));
isc_log_iwrite(isc_lctx, category, module, level,
msgcat, msgset, message,
"socket %p %s: %s", sock, peerbuf, msgbuf);
isc_log_write(isc_lctx, category, module, level,
"socket %p %s: %s", sock, peerbuf, msgbuf);
}
}
@@ -962,10 +957,7 @@ select_poke(isc__socketmgr_t *mgr, int threadid, int fd, int msg) {
if (cc < 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
FATAL_ERROR(__FILE__, __LINE__,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_WRITEFAILED,
"write() failed "
"during watcher poke: %s"),
"write() failed during watcher poke: %s",
strbuf);
}
@@ -990,10 +982,7 @@ select_readmsg(isc__socketthread_t *thread, int *fd, int *msg) {
strerror_r(errno, strbuf, sizeof(strbuf));
FATAL_ERROR(__FILE__, __LINE__,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_READFAILED,
"read() failed "
"during watcher poke: %s"),
"read() failed during watcher poke: %s",
strbuf);
}
INSIST(cc == sizeof(buf));
@@ -1141,7 +1130,6 @@ process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
cmsgp = CMSG_FIRSTHDR(msg);
while (cmsgp != NULL) {
socket_log(sock, NULL, TRACE,
isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PROCESSCMSG,
"processing cmsg %p", cmsgp);
if (cmsgp->cmsg_level == IPPROTO_IPV6
@@ -1152,8 +1140,6 @@ process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
sizeof(struct in6_pktinfo));
dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
socket_log(sock, NULL, TRACE,
isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_IFRECEIVED,
"interface received on ifindex %u",
dev->pktinfo.ipi6_ifindex);
if (IN6_IS_ADDR_MULTICAST(&pktinfop->ipi6_addr))
@@ -1254,7 +1240,6 @@ build_msghdr_send(isc__socket_t *sock, char* cmsgbuf, isc_socketevent_t *dev,
struct in6_pktinfo *pktinfop;
socket_log(sock, NULL, TRACE,
isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_SENDTODATA,
"sendto pktinfo data, ifindex %u",
dev->pktinfo.ipi6_ifindex);
@@ -1324,12 +1309,8 @@ build_msghdr_send(isc__socket_t *sock, char* cmsgbuf, isc_socketevent_t *dev,
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IP_TOS, %.02x)"
" %s: %s",
" failed: %s",
sock->fd, dscp >> 2,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
strbuf);
} else
sock->dscp = dscp;
@@ -1354,12 +1335,8 @@ build_msghdr_send(isc__socket_t *sock, char* cmsgbuf, isc_socketevent_t *dev,
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_TCLASS, "
"%.02x) %s: %s",
"%.02x) failed: %s",
sock->fd, dscp >> 2,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
strbuf);
} else
sock->dscp = dscp;
@@ -1548,8 +1525,6 @@ doio_recv(isc__socket_t *sock, isc_socketevent_t *dev) {
if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) {
strerror_r(recv_errno, strbuf, sizeof(strbuf));
socket_log(sock, NULL, IOEVENT,
isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_DOIORECV,
"doio_recv: recvmsg(%d) %d bytes, err %d/%s",
sock->fd, cc, recv_errno, strbuf);
}
@@ -1616,8 +1591,6 @@ doio_recv(isc__socket_t *sock, isc_socketevent_t *dev) {
if (isc_sockaddr_getport(&dev->address) == 0) {
if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) {
socket_log(sock, &dev->address, IOEVENT,
isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_ZEROPORT,
"dropping source port zero packet");
}
return (DOIO_SOFT);
@@ -1631,7 +1604,6 @@ doio_recv(isc__socket_t *sock, isc_socketevent_t *dev) {
}
socket_log(sock, &dev->address, IOEVENT,
isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PKTRECV,
"packet received correctly");
/*
@@ -1778,9 +1750,7 @@ doio_send(isc__socket_t *sock, isc_socketevent_t *dev) {
inc_stats(sock->manager->stats,
sock->statsindex[STATID_SENDFAIL]);
UNEXPECTED_ERROR(__FILE__, __LINE__,
"doio_send: send() %s 0",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_RETURNED, "returned"));
"doio_send: send() returned 0");
}
/*
@@ -1861,8 +1831,7 @@ destroy(isc__socket_t **sockp) {
isc__socketmgr_t *manager = sock->manager;
isc__socketthread_t *thread;
socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_DESTROYING, "destroying");
socket_log(sock, NULL, CREATION, "destroying");
INSIST(ISC_LIST_EMPTY(sock->connect_list));
INSIST(ISC_LIST_EMPTY(sock->accept_list));
@@ -2258,12 +2227,10 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
if (sock->fd >= (int)manager->maxsocks) {
(void)close(sock->fd);
isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_TOOMANYFDS,
"socket: file descriptor exceeds limit (%d/%u)",
sock->fd, manager->maxsocks);
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
"socket: file descriptor exceeds limit (%d/%u)",
sock->fd, manager->maxsocks);
inc_stats(manager->stats, sock->statsindex[STATID_OPENFAIL]);
return (ISC_R_NORESOURCES);
}
@@ -2273,11 +2240,9 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
case EMFILE:
case ENFILE:
strerror_r(errno, strbuf, sizeof(strbuf));
isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_TOOMANYFDS,
"%s: %s", err, strbuf);
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
"%s: %s", err, strbuf);
/* fallthrough */
case ENOBUFS:
inc_stats(manager->stats,
@@ -2299,11 +2264,7 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
default:
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"%s() %s: %s", err,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
"%s() failed: %s", err,
strbuf);
inc_stats(manager->stats,
sock->statsindex[STATID_OPENFAIL]);
@@ -2329,10 +2290,8 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
(void *)&on, sizeof(on)) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, SO_BSDCOMPAT) %s: %s",
"setsockopt(%d, SO_BSDCOMPAT) failed: %s",
sock->fd,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
strbuf);
/* Press on... */
}
@@ -2343,10 +2302,8 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
(void *)&on, sizeof(on)) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, SO_NOSIGPIPE) %s: %s",
"setsockopt(%d, SO_NOSIGPIPE) failed: %s",
sock->fd,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
strbuf);
/* Press on... */
}
@@ -2370,12 +2327,8 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
&& errno != ENOPROTOOPT) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, SO_TIMESTAMP) %s: %s",
"setsockopt(%d, SO_TIMESTAMP) failed: %s",
sock->fd,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
strbuf);
/* Press on... */
}
@@ -2389,11 +2342,7 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_RECVPKTINFO) "
"%s: %s", sock->fd,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
"failed: %s", sock->fd,
strbuf);
}
#else
@@ -2403,12 +2352,8 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
(void *)&on, sizeof(on)) < 0)) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_PKTINFO) %s: %s",
"setsockopt(%d, IPV6_PKTINFO) failed: %s",
sock->fd,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
strbuf);
}
#endif /* IPV6_RECVPKTINFO */
@@ -2469,12 +2414,8 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
(void *)&rcvbuf, sizeof(rcvbuf)) == -1) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, SO_RCVBUF, %d) %s: %s",
"setsockopt(%d, SO_RCVBUF, %d) failed: %s",
sock->fd, rcvbuf,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
strbuf);
}
}
@@ -2490,12 +2431,8 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
(void *)&sndbuf, sizeof(sndbuf)) == -1) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, SO_SNDBUF, %d) %s: %s",
"setsockopt(%d, SO_SNDBUF, %d) failed: %s",
sock->fd, sndbuf,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
strbuf);
}
}
@@ -2508,9 +2445,7 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_RECVTCLASS) "
"%s: %s", sock->fd,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
"failed: %s", sock->fd,
strbuf);
}
#endif
@@ -2521,9 +2456,7 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IP_RECVTOS) "
"%s: %s", sock->fd,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
"failed: %s", sock->fd,
strbuf);
}
#endif
@@ -2627,8 +2560,8 @@ socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type,
#endif
UNLOCK(&manager->lock);
socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_CREATED, dup_socket != NULL ? "dupped" : "created");
socket_log(sock, NULL, CREATION,
dup_socket != NULL ? "dupped" : "created");
return (ISC_R_SUCCESS);
}
@@ -2889,7 +2822,6 @@ internal_accept(isc__socket_t *sock) {
LOCK(&sock->lock);
socket_log(sock, NULL, TRACE,
isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK,
"internal_accept called, locked socket");
manager = sock->manager;
@@ -2946,12 +2878,10 @@ internal_accept(isc__socket_t *sock) {
switch (errno) {
case ENFILE:
case EMFILE:
isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_TOOMANYFDS,
"%s: too many open file descriptors",
err);
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
"%s: too many open file descriptors",
err);
goto soft_error;
case ENOBUFS:
@@ -2975,11 +2905,7 @@ internal_accept(isc__socket_t *sock) {
}
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"internal_accept: %s() %s: %s", err,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
"internal_accept: %s() failed: %s", err,
strbuf);
fd = -1;
result = ISC_R_UNEXPECTED;
@@ -3005,13 +2931,10 @@ internal_accept(isc__socket_t *sock) {
(void)close(fd);
goto soft_error;
} else if (fd >= (int)manager->maxsocks) {
isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_TOOMANYFDS,
"accept: "
"file descriptor exceeds limit (%d/%u)",
fd, manager->maxsocks);
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
"accept: file descriptor exceeds limit (%d/%u)",
fd, manager->maxsocks);
(void)close(fd);
goto soft_error;
}
@@ -3094,7 +3017,6 @@ internal_accept(isc__socket_t *sock) {
#endif
socket_log(sock, &NEWCONNSOCK(dev)->peer_address, CREATION,
isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN,
"accepted connection, new socket %p",
dev->newsocket);
@@ -3140,7 +3062,6 @@ internal_recv(isc__socket_t *sock) {
}
socket_log(sock, NULL, IOEVENT,
isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV,
"internal_recv: event %p -> task %p", dev, dev->ev_sender);
/*
@@ -3193,8 +3114,8 @@ internal_send(isc__socket_t *sock) {
if (dev == NULL) {
goto finish;
}
socket_log(sock, NULL, EVENT, NULL, 0, 0,
"internal_send: event %p -> task %p",
socket_log(sock, NULL, EVENT,
"internal_send: event %p -> task %p",
dev, dev->ev_sender);
/*
@@ -3427,10 +3348,7 @@ process_ctlfd(isc__socketthread_t *thread) {
select_readmsg(thread, &fd, &msg);
thread_log(thread, IOEVENT,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_WATCHERMSG,
"watcher got message %d "
"for socket %d"), msg, fd);
"watcher got message %d for socket %d", msg, fd);
/*
* Nothing to read?
@@ -3576,11 +3494,7 @@ netthread(void *uap) {
if (cc < 0 && !SOFT_ERROR(errno)) {
strerror_r(errno, strbuf, sizeof(strbuf));
FATAL_ERROR(__FILE__, __LINE__,
"%s %s: %s", fnname,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"), strbuf);
"%s failed: %s", fnname, strbuf);
}
#if defined(USE_DEVPOLL) && defined(ISC_SOCKET_USE_POLLWATCH)
@@ -3626,9 +3540,7 @@ netthread(void *uap) {
#endif
}
thread_log(thread, TRACE, "%s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_EXITING, "watcher exiting"));
thread_log(thread, TRACE, "watcher exiting");
return ((isc_threadresult_t)0);
}
@@ -3687,9 +3599,7 @@ setup_thread(isc__socketthread_t *thread) {
if (pipe(thread->pipe_fds) != 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"pipe() %s: %s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
"pipe() failed: %s",
strbuf);
return (ISC_R_UNEXPECTED);
}
@@ -3705,9 +3615,7 @@ setup_thread(isc__socketthread_t *thread) {
result = isc__errno2result(errno);
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"kqueue %s: %s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
"kqueue failed: %s",
strbuf);
isc_mem_put(thread->manager->mctx, thread->events,
sizeof(struct kevent) * thread->nevents);
@@ -3740,9 +3648,7 @@ setup_thread(isc__socketthread_t *thread) {
result = isc__errno2result(errno);
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"epoll_create %s: %s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
"epoll_create failed: %s",
strbuf);
return (result);
@@ -3775,9 +3681,7 @@ setup_thread(isc__socketthread_t *thread) {
result = isc__errno2result(errno);
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"open(/dev/poll) %s: %s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
"open(/dev/poll) failed: %s",
strbuf);
isc_mem_put(thread->manager->mctx, thread->events,
sizeof(struct pollfd) * thread->nevents);
@@ -3837,9 +3741,7 @@ cleanup_thread(isc_mem_t *mctx, isc__socketthread_t *thread) {
result = unwatch_fd(thread, thread->pipe_fds[0], SELECT_POKE_READ);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"epoll_ctl(DEL) %s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"));
"epoll_ctl(DEL) failed");
}
#ifdef USE_KQUEUE
close(thread->kqueue_fd);
@@ -4000,10 +3902,7 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp) {
* Wait for all sockets to be destroyed.
*/
while (!ISC_LIST_EMPTY(manager->socklist)) {
manager_log(manager, CREATION, "%s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_SOCKETSREMAIN,
"sockets exist"));
manager_log(manager, CREATION, "sockets exist");
WAIT(&manager->shutdown_ok, &manager->lock);
}
@@ -4026,11 +3925,7 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp) {
result = isc_thread_join(manager->threads[i].thread, NULL);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_thread_join() %s",
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"));
"isc_thread_join() failed");
}
cleanup_thread(manager->mctx, &manager->threads[i]);
}
@@ -4107,7 +4002,7 @@ socket_recv(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
SELECT_POKE_READ);
}
socket_log(sock, NULL, EVENT, NULL, 0, 0,
socket_log(sock, NULL, EVENT,
"socket_recv: event %p -> task %p",
dev, ntask);
@@ -4208,10 +4103,9 @@ socket_send(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
if (!isc_sockaddr_issitelocal(&dev->address) &&
!isc_sockaddr_islinklocal(&dev->address)) {
socket_log(sock, NULL, TRACE, isc_msgcat,
ISC_MSGSET_SOCKET, ISC_MSG_PKTINFOPROVIDED,
"pktinfo structure provided, ifindex %u "
"(set to 0)", pktinfo->ipi6_ifindex);
socket_log(sock, NULL, TRACE,
"pktinfo structure provided, ifindex %u (set to 0)",
pktinfo->ipi6_ifindex);
/*
* Set the pktinfo index to 0 here, to let the
@@ -4261,7 +4155,7 @@ socket_send(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
sock->fd,
SELECT_POKE_WRITE);
}
socket_log(sock, NULL, EVENT, NULL, 0, 0,
socket_log(sock, NULL, EVENT,
"socket_send: event %p -> task %p",
dev, ntask);
@@ -4571,17 +4465,13 @@ isc_socket_bind(isc_socket_t *sock0, const isc_sockaddr_t *sockaddr,
(void *)&on, sizeof(on)) < 0)
{
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d) %s", sock->fd,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"));
"setsockopt(%d) failed", sock->fd);
}
if (setsockopt(sock->fd, SOL_SOCKET, SO_REUSEPORT,
(void *)&on, sizeof(on)) < 0)
{
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d) %s", sock->fd,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"));
"setsockopt(%d) failed", sock->fd);
}
/* Press on... */
}
@@ -4610,8 +4500,7 @@ isc_socket_bind(isc_socket_t *sock0, const isc_sockaddr_t *sockaddr,
}
}
socket_log(sock, sockaddr, TRACE,
isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "bound");
socket_log(sock, sockaddr, TRACE, "bound");
sock->bound = 1;
UNLOCK(&sock->lock);
@@ -4644,9 +4533,8 @@ isc_socket_filter(isc_socket_t *sock0, const char *filter) {
if (setsockopt(sock->fd, SOL_SOCKET, SO_ACCEPTFILTER,
&afa, sizeof(afa)) == -1) {
strerror_r(errno, strbuf, sizeof(strbuf));
socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_FILTER, "setsockopt(SO_ACCEPTFILTER): %s",
strbuf);
socket_log(sock, NULL, CREATION,
"setsockopt(SO_ACCEPTFILTER): %s", strbuf);
return (ISC_R_FAILURE);
}
return (ISC_R_SUCCESS);
@@ -5311,13 +5199,8 @@ isc_socket_ipv6only(isc_socket_t *sock0, bool yes) {
char strbuf[ISC_STRERRORSIZE];
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_V6ONLY) "
"%s: %s", sock->fd,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
strbuf);
"setsockopt(%d, IPV6_V6ONLY) failed: %s",
sock->fd, strbuf);
}
}
#endif
@@ -5338,12 +5221,8 @@ setdscp(isc__socket_t *sock, isc_dscp_t dscp) {
char strbuf[ISC_STRERRORSIZE];
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IP_TOS, %.02x) "
"%s: %s", sock->fd, value >> 2,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
"setsockopt(%d, IP_TOS, %.02x) failed: %s",
sock->fd, value >> 2,
strbuf);
}
}
@@ -5355,13 +5234,8 @@ setdscp(isc__socket_t *sock, isc_dscp_t dscp) {
char strbuf[ISC_STRERRORSIZE];
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_TCLASS, %.02x) "
"%s: %s", sock->fd, dscp >> 2,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
"failed"),
strbuf);
"setsockopt(%d, IPV6_TCLASS, %.02x) failed: %s",
sock->fd, dscp >> 2, strbuf);
}
}
#endif