2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-23 02:28:55 +00:00

507 Commits

Author SHA1 Message Date
Ondřej Surý
e3e6888946 Make the usage of json-c objects opaque to the caller
The json-c have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:04:20 +02:00
Ondřej Surý
0771dd3be8 Make the usage of libxml2 opaque to the caller
The libxml2 have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:01:32 +02:00
Mark Andrews
134248531c silence unchecked return 2019-06-24 19:50:43 -04:00
Witold Kręcicki
e517c18d98 Fix a possible race between udp dispatch and socket code
There's a small possibility of race between udp dispatcher and
socket code - socket code can still hold internal reference to a
socket while dispatcher calls isc_socket_open, which can cause
an assertion failure. Fix it by relaxing the assertion test, and
instead simply locking the socket in isc_socket_open.
2019-05-31 11:21:28 -07:00
Ondřej Surý
4d2d3b49ce Cleanup the way we detect json-c library to use only pkg-config 2019-05-29 15:08:52 +02:00
Witold Kręcicki
75815c1581 Fix a possible deadlock in TCP accepting
Each network thread holds an array of locks, indexed by a hash
of fd. When we accept a connection we hold a lock in accepting thread.
We then generate the thread number and lock bucket for the new
connection socket - if we hit the same thread and lock bucket as
accepting socket we get a deadlock. Avoid this by checking if we're
in the same thread/lock bucket and not locking in this case.
2019-05-24 03:18:41 -04:00
Ondřej Surý
eb8c9bdd55 Make lib/isc/app.c opaque and thread-safe
This work cleans up the API which includes couple of things:

1. Make the isc_appctx_t type fully opaque

2. Protect all access to the isc_app_t members via stdatomics

3. sigwait() is part of POSIX.1, remove dead non-sigwait code

4. Remove unused code: isc_appctx_set{taskmgr,sockmgr,timermgr}
2019-05-20 18:13:02 +02:00
Ondřej Surý
94cb73d96c Use SO_REUSEPORT_LB on FreeBSD if available 2019-05-15 07:30:23 +02:00
Ondřej Surý
1c672367a0 Add safeguard against the other usage of SO_REUSEPORT 2019-05-15 07:30:23 +02:00
Mark Andrews
265554f895 use isc_refcount_decrement to decrement NEWCONNSOCK(dev)->references; use isc_refcount_increment instead of isc_refcount_init in socket_create 2019-04-23 00:12:17 -04:00
Ondřej Surý
78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01:00
Witold Kręcicki
b57a38ae43 Fix a race in socket code when internal_{accept, send, receive} is called
from event loop on an socket and, in the meantime, someone has closed this
socket.
2019-03-06 12:56:11 -08:00
Mark Andrews
f87b88e520 remove dead assignments 2019-02-19 08:12:09 +11:00
Mark Andrews
bd529b1f30 silence coverity issues; move isc_refcount_decrement out of INSIST 2019-01-10 14:42:28 +11:00
Ondřej Surý
e2cdf066ea Remove message catalogs 2019-01-09 23:44:26 +01:00
Witold Kręcicki
ddc1d4d6d4 Fix a race between process_fd and socketclose in unix socket code. [GL #744] 2018-12-05 12:03:52 +00:00
Mark Andrews
509dad8737 handle systems without IPv4 2018-11-23 12:05:53 +11:00
Mark Andrews
6696a40ea9 address resource leak; don't call close() on socket error; 2018-11-23 10:34:59 +11:00
Witold Kręcicki
929ea7c2c4 - Make isc_mutex_destroy return void
- Make isc_mutexblock_init/destroy return void
- Minor cleanups
2018-11-22 11:52:08 +00:00
Ondřej Surý
2f3eee5a4f isc_mutex_init returns 'void' 2018-11-22 11:51:49 +00:00
Ondřej Surý
73a8999d1c isc_condition_init returns 'void' 2018-11-22 11:51:49 +00:00
Witold Kręcicki
79afbe2966 Some comments 2018-11-15 08:21:40 +00:00
Witold Kręcicki
16d329d55b Work with assumption that isc_mem_get always succeds; Crash if isc_thread_create, isc_mutex_init or isc_condition_init fails 2018-11-15 08:21:40 +00:00
Evan Hunt
1f0cd6606e style: one-line statement braces, line length, etc 2018-11-15 08:21:40 +00:00
Witold Krecicki
e55bbec66e FreeBSD fixes - proper affinity setting, don't use SO_REUSEPORT 2018-11-15 08:21:17 +00:00
Witold Krecicki
3f7d79e574 Don't doublelock fdlock on Solaris 2018-11-15 08:21:17 +00:00
Witold Kręcicki
c1a4f0e66a Use multiple worker queues (using isc_task_sendto()) in unix socket code 2018-11-15 08:21:17 +00:00
Witold Kręcicki
b2b210d6d9 Make watching/unwatching sockets saner. 2018-11-15 08:21:17 +00:00
Witold Kręcicki
d652551e86 Use the newly accepted FD in TCP code. 2018-11-15 08:21:17 +00:00
Witold Kręcicki
88edf8fe4d Use isc_refcount_t in socket reference counting. 2018-11-15 08:21:17 +00:00
Witold Krecicki
7223790380 Multiple network event loop threads support for Solarises /dev/poll. 2018-11-15 08:21:17 +00:00
Witold Kręcicki
9c926a5d9b Mangle fdlocks a bit.
Mutexes are slower if they're in the same cache line. Since
fd's come in herds, and usually our listen sockets will have nearby
fd numbers, we mangle fdlocks so that the locks are further away.
2018-11-15 08:21:17 +00:00
Witold Kręcicki
58d75d9d8d Fix a race between socket closing and incoming event. 2018-11-15 08:21:17 +00:00
Witold Kręcicki
f94f4bc1f4 Set network threads CPU affintity. 2018-11-15 08:21:17 +00:00
Witold Kręcicki
bd024eee57 Add runtime detection of SO_REUSEPORT, use it instead of dup() if available. 2018-11-15 08:21:17 +00:00
Witold Krecicki
6feb688f69 Use multiple network event loop threads with separate data structures. 2018-11-15 08:21:17 +00:00
Witold Kręcicki
cbc1b12311 Do IO after event directly in the network thread, don't queue an event in a separate task. 2018-11-15 08:21:17 +00:00
Witold Kręcicki
778ab8158a Remove fdwatch sockets, those are not used anywhere. 2018-11-15 08:21:17 +00:00
Ondřej Surý
23fff6c569 Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 12:22:17 +07:00
Ondřej Surý
b2b43fd235 Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 12:21:53 +07:00
Witold Kręcicki
54b9690a4e Remove vector socket functions from Unix socket code and library headers
Remove the following functions in order to simplify socket code:

  - isc_socket_recvv()
  - isc_socket_sendtov()
  - isc_socket_sendtov2()
  - isc_socket_sendv()
2018-10-31 12:12:53 +01:00
Mark Andrews
561b780ba0 Only set IPV6_USE_MIN_MTU on IPv6. 2018-10-29 16:49:33 +11:00
Witold Kręcicki
38a127c35b Remove layering from isc_task, isc_app, isc_socket, isc_timer, isc_mem 2018-10-18 09:19:12 +00:00
Witold Kręcicki
cdbac34cba Get rid of isc_bind9 conditional 2018-10-18 09:19:12 +00:00
Mark Andrews
81b133d963 avoid macro name collision with system defined macro 2018-09-10 09:18:17 +10:00
Ondřej Surý
2750799132 Assume socklen_t is always available on all supported platforms (except on Windows where it is typedefed to int32_t) 2018-09-07 12:17:40 +02:00
Ondřej Surý
f1d3055d7b Replace platform ISC_PLATFORM_HAVETFO with config ENABLE_TCP_FASTOPEN 2018-09-07 12:17:30 +02:00
Ondřej Surý
092edb5b44 Replace platform ISC_PLATFORM_HAVEDEVPOLL with check for devpoll.h headers 2018-09-07 12:17:30 +02:00
Ondřej Surý
5d65392d18 Replace platform ISC_PLATFORM_HAVEEPOLL with config HAVE_EPOLL_CREATE1 2018-09-07 12:17:30 +02:00
Ondřej Surý
68f473a25e Replace platform ISC_PLATFORM_HAVEKQUEUE with config HAVE_KQUEUE 2018-09-07 12:17:30 +02:00