Michał Kępień
00bc5bf6bd
Fix isc_buffer_copyregion() for auto-reallocated buffers
...
While isc_buffer_copyregion() calls isc_buffer_reserve() to ensure the
target buffer will have enough available space to append the contents of
the source region to it, the variables used for subsequently checking
available space are not updated accordingly after that call. This
prevents isc_buffer_copyregion() from working as expected for
auto-reallocated buffers: ISC_R_NOSPACE will be returned if enough space
is not already available in the target buffer before it is reallocated.
Fix by calling isc_buffer_used() and isc_buffer_availablelength()
directly instead of assigning their return values to local variables.
(cherry picked from commit e1f0aed034 )
2018-10-30 13:34:49 +01:00
Michał Kępień
b549996d58
Add unit tests for isc_buffer_copyregion()
...
Add some basic checks for isc_buffer_copyregion() to ensure it behaves
as expected for both fixed-size buffers and buffers which can be
automatically reallocated. Adjust the list of headers included by
lib/isc/tests/buffer_test.c so that it matches what that test program
really uses.
(cherry picked from commit 15440d8027 )
2018-10-30 13:34:48 +01:00
Mark Andrews
67816c747d
document eol
...
(cherry picked from commit 97a680e5ce )
2018-10-30 11:18:06 +11:00
Mark Andrews
bf299d5ee1
Only set IPV6_USE_MIN_MTU on IPv6.
...
(cherry picked from commit 561b780ba0 )
2018-10-29 17:29:36 +11:00
Mark Andrews
169b5ee36f
expand the pool then copy over the old entries so we that failures do not break the old pool; also don't leak the new pool on error
...
(cherry picked from commit afde30fe9b )
2018-10-25 13:20:14 +11:00
Tinderbox User
186cf94c9a
prep 9.11.5rc1
2018-09-29 03:57:26 +00:00
Zhaolong Zhang
f889f48f61
Fix crash caused by race condition in timer creation
...
The race condition is the timer elapses before isc__timer_create()
returns the pointer to the caller. Assigning the return pointer before
enabling the timer will fix it.
(cherry picked from commit 21966423cd )
2018-09-27 13:00:05 -07:00
Mark Andrews
ced589e379
avoid macro name collision with system defined macro
...
(cherry picked from commit 81b133d963 )
2018-09-10 09:30:59 +10:00
Ondřej Surý
b92a1791b3
Use isc/stdatomic.h to switch to __atomic builtins when compiling in C++ mode
2018-09-07 16:55:22 +02:00
Witold Kręcicki
3da95ab2ed
Align CMSG buffers to a void* boundary, fixes crash on architectures with strict alignment
...
CHANGES entry
(cherry picked from commit 17212cf996 )
2018-09-07 10:30:12 +02:00
Ondřej Surý
302cae89f3
Bail-out early in the for install loops instead of continuing because for masks the error in the middle
...
(cherry picked from commit 25248eb097 )
(cherry picked from commit 3fbceba0a8 )
2018-09-03 13:49:35 +02:00
Witold Krecicki
eec06494aa
Silence some warnings and errors
...
(cherry picked from commit 0f0dfc7f86 )
2018-08-31 17:54:54 -07:00
Mark Andrews
c2c7020057
use sizeof(CK_SLOT_ID)
...
(cherry picked from commit 2c1d8b2e99 )
2018-08-24 11:33:12 +10:00
Mark Andrews
58e33fcdb4
unlink before unlock
...
(cherry picked from commit 4742f4ecba )
2018-08-24 10:58:30 +10:00
Ondřej Surý
32a0d602ea
We want to install compatibility shim isc/int.h and isc/boolean.h headers
2018-08-22 09:07:39 +02:00
Mark Andrews
d5cef9cd55
fix lock order reversal
...
(cherry picked from commit 2bb4392bb3 )
2018-08-21 13:33:37 +10:00
Ondřej Surý
a2ffc37ad3
Don't install removed int.h and boolean.h headers
2018-08-14 20:14:05 -04:00
Mark Andrews
a21b1b86dc
mempool didn't work for sizes less than sizeof(void*)
...
(cherry picked from commit 5dd1beec8e )
2018-08-14 09:12:41 -07:00
Ondřej Surý
af6fe731fb
Make ENOBUFS a soft error
...
(cherry picked from commit ebf3083e08 )
2018-08-13 19:23:21 +02:00
Ondřej Surý
71059dac02
Fix various build failures on Windows (Courtesy of rockerinthelocker)
2018-08-11 05:57:52 -04:00
Ondřej Surý
bfd31e282a
Fix missing config.h in win32/socket.c and replace config.h with <config.h>
...
(cherry picked from commit d87c1a120d )
2018-08-11 11:00:50 +02:00
Ondřej Surý
0a10dfa524
Add compatibility isc/boolean.h and isc/int.h headers
...
(cherry picked from commit 0dad73aafa )
2018-08-10 15:20:58 +02:00
Ondřej Surý
eb745a2125
Remove duplicate config.h
...
(cherry picked from commit 7351c505a0 )
(cherry picked from commit 2844f6529d )
2018-08-10 15:20:58 +02:00
Ondřej Surý
1084b40b44
Replace custom isc_boolean_t with C standard bool type
...
(cherry picked from commit 994e656977 )
(cherry picked from commit 884929400c )
2018-08-10 15:20:57 +02:00
Ondřej Surý
aaa76dc654
Replace custom isc_u?intNN_t types with C99 u?intNN_t types
...
(cherry picked from commit cb6a185c69 )
(cherry picked from commit d61e6a3111 )
2018-08-10 15:20:57 +02:00
Ondřej Surý
07970c501d
Get rid of extra UINT64_MAX definition in lib/isc/win32/time.c
...
(cherry picked from commit 055278c936 )
(cherry picked from commit 3523850065 )
2018-08-10 15:20:57 +02:00
Ondřej Surý
bfc6a25f2d
Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants
...
(cherry picked from commit 64fe6bbaf2 )
(cherry picked from commit c863a076ae )
2018-08-10 15:20:57 +02:00
Mark Andrews
4130859964
remove dead code
...
(cherry picked from commit 83a1e87dd2 )
2018-08-03 09:50:45 +10:00
Tinderbox User
3bbd725a2c
prep 9.11.4rc2
2018-06-28 05:07:42 +00:00
Witold Kręcicki
5e375f8b52
Use completely static-sized buffers
...
(cherry picked from commit 49f90025a0 )
(cherry picked from commit 4007a9d020 )
2018-06-26 15:23:28 -04:00
Witold Kręcicki
cd7bf90a54
Fix socket cmsg buffer usage
...
(cherry picked from commit d79be7dd5e )
(cherry picked from commit da63e95612 )
2018-06-26 15:23:28 -04:00
Evan Hunt
a1690b24bc
prepare 9.11.4rc1
2018-06-21 18:54:43 +02:00
Evan Hunt
b75a2b9730
improve readability of radix code
...
- use RADIX_V4, RADIX_V6, RADIX_V4_ECS, and RADIX_V6_ECS as array
indices instead of 0 through 3.
- remove some unused macros
(cherry picked from commit f7f20b1202 )
2018-06-08 12:11:19 -07:00
Mark Andrews
fed871b720
ISC_SOCKEVENTATTR_TRUNC was not be set
...
(cherry picked from commit 6bff1768cf )
2018-05-18 16:00:36 +10:00
Mark Andrews
4868351c45
look for '\0'
...
(cherry picked from commit d03a81c265 )
2018-05-18 12:45:14 +10:00
Mark Andrews
0256a07b96
add some %f format tests
...
(cherry picked from commit f5233ba5de )
2018-05-18 12:45:14 +10:00
Michał Kępień
803537b991
isc_buffer_*(): if source can be NULL, only call memmove() when length is non-zero
...
Certain isc_buffer_*() functions might call memmove() with the second
argument (source) set to NULL and the third argument (length) set to 0.
While harmless, it triggers an ubsan warning:
runtime error: null pointer passed as argument 2, which is declared to never be null
Modify all memmove() call sites in lib/isc/include/isc/buffer.h and
lib/isc/buffer.c which may potentially use NULL as the second argument
(source) so that memmove() is only called if the third argument (length)
is non-zero.
(cherry picked from commit 6ddbca6f2b )
2018-05-15 09:32:19 +02:00
Ondřej Surý
188526f41c
Remove $Id markers, Principal Author and Reviewed tags from the full source tree
...
(cherry picked from commit 55a10b7acd )
2018-05-11 14:25:15 +02:00
Michał Kępień
b4f07af8df
Address GCC 8 -Wformat-truncation warnings
...
(cherry picked from commit 172d0c401e )
2018-05-10 10:54:38 +02:00
Ondřej Surý
358ef09a6e
Also test the higher part of the confidence interval
...
(cherry picked from commit 8d3220643c )
2018-05-03 15:05:20 +02:00
Mark Andrews
cdce9f752c
remove exit calls after FATAL_ERROR
...
(cherry picked from commit f8d2a46daa )
2018-04-20 18:47:39 -04:00
Mark Andrews
578714e8f1
use %u instead of %d for unsigned int arguments
...
(cherry picked from commit 49f8e9571c )
2018-04-20 18:47:39 -04:00
Ondřej Surý
cf5598156d
Sync isc_file_template functions between unix and win32, so they are same
...
(cherry picked from commit 8c99d104e3 )
2018-04-12 09:00:13 +02:00
Ondřej Surý
6f550b33bf
Cherry-pick changes to isc_file_template and associated unit test from v9_12 to v9_11
...
(cherry picked parts of commit 2dfb992349 )
2018-04-12 08:59:35 +02:00
Ondřej Surý
d69d5b96c1
Define PATH_MAX on Windows as _MAX_PATH, so we can use it everywhere
...
(cherry picked from commit 7467735258 )
2018-04-11 14:38:10 +02:00
Evan Hunt
09cf48603a
update file headers
2018-03-15 18:38:48 -07:00
Evan Hunt
14e22ddf8c
add an 'untested' case when none of the atomic operations are available
...
- this fixes a build failure introduced in change 4913 when
compiling with ATF and --disable-atomic
(cherry picked from commit 1b3eac926e )
2018-03-15 12:09:38 -07:00
Evan Hunt
8b205089b7
update file headers to remove copyright years
2018-03-14 16:40:20 -07:00
Ondřej Surý
413b7d4b24
Update whitespace
2018-03-14 12:45:03 +01:00
Evan Hunt
e98ec51b96
Fix compiler warnings and test failures when building without threads
...
(cherry picked from commit 56353aaf42 )
2018-03-10 10:37:20 -08:00