]> git.proxmox.com Git - mirror_kronosnet.git/log
mirror_kronosnet.git
4 years ago[rx] copy data into the defrag buffer only if we know the size of the frame
Fabio M. Di Nitto [Tue, 15 Oct 2019 05:02:05 +0000 (07:02 +0200)]
[rx] copy data into the defrag buffer only if we know the size of the frame

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[host] fix defrag buffers reclaim logic
Fabio M. Di Nitto [Tue, 15 Oct 2019 04:53:24 +0000 (06:53 +0200)]
[host] fix defrag buffers reclaim logic

The problem:

- let's assume a 2 nodes (A and B) cluster setup
- node A sends fragmented packets to node B and there is
  packet loss on the network.
- node B receives all those fragments and attempts to
  reassemble them.
- node A sends packet seq_num X in Y fragments.
- node B receives only part of the fragments and stores
  them in a defrag buf.
- packet loss stops.
- node A continues to send packets and a seq_num
  roll-over takes place.
- node A sends a new packet seq_num X in Y fragments.
- node B gets confused here because the parts of the old
  packet seq_num X are still stored and the buffer
  has not been reclaimed.
- node B continues to rebuild packet seq_num X with
  old stale data and new data from after the roll-over.
- node B completes reassembling the packet and delivers
  junk to the application.

The solution:

Add a much stronger buffer reclaim logic that will apply
on each received packet and not only when defrag buffers
are needed, as there might be a mix of fragmented and not
fragmented packets in-flight.

The new logic creates a window of N packets that can be
handled at the same time (based on the number of buffers)
and clear everything else.

Fixes https://github.com/kronosnet/kronosnet/issues/261

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[host] rename variables to make it easier to read the code
Fabio M. Di Nitto [Tue, 15 Oct 2019 04:46:36 +0000 (06:46 +0200)]
[host] rename variables to make it easier to read the code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #263 from kronosnet/runtime-debug
Fabio M. Di Nitto [Wed, 9 Oct 2019 10:45:56 +0000 (12:45 +0200)]
Merge pull request #263 from kronosnet/runtime-debug

[build] add --with-sanitizers= option for sanitizer builds

4 years ago[build] add --with-sanitizers= option for sanitizer builds
Fabio M. Di Nitto [Wed, 9 Oct 2019 08:28:14 +0000 (10:28 +0200)]
[build] add --with-sanitizers= option for sanitizer builds

this option is stricly meant for runtime debugging purposes.
do NOT use in production.

check gcc/clang man pages on how to use ASAN/UBSAN/TSAN.

Also allow users to specificy SANITIZERS_CFLAGS and SANITIZERS_LDFLAGS
for advanced use.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #262 from ThomasLamprecht/fix-doxyxml-overflow
Fabio M. Di Nitto [Wed, 9 Oct 2019 05:35:55 +0000 (07:35 +0200)]
Merge pull request #262 from ThomasLamprecht/fix-doxyxml-overflow

doxyxml: print_param: fix heap-buffer-overflow on read

4 years agodoxyxml: print_param: fix heap-buffer-overflow on read
Thomas Lamprecht [Tue, 8 Oct 2019 15:09:07 +0000 (17:09 +0200)]
doxyxml: print_param: fix heap-buffer-overflow on read

in read_struct we can get the pi->paramtype assigned with:
> pi->paramtype = type?strdup(type):strdup("");

And in print_param we then always check the last character by getting
the strlen and subtracting one. But in the case where either type was
NULL and we assigned an empty string, or type wasn't null but
pointing to an empty string we ran into an read-heap-buffer-overflow
as here strlen is zero, and so we the first if branch evaluated to
> if (pi->paramtype[-1] == '*') {
which isn't valid. Depending on the OS, protection of surrounding
area due to said OS or the compiler, this can crash the program.

Similar issue was the case for the next check for double pointers,
here for all strings with strlen < 2.

To solve this get the strlen early and check if we cannot underflow
before doing the real read.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoMerge pull request #260 from kronosnet/test-suite
Fabio M. Di Nitto [Thu, 26 Sep 2019 10:17:36 +0000 (12:17 +0200)]
Merge pull request #260 from kronosnet/test-suite

[tests] add common function to sleep based on how the test suite is r…

4 years ago[tests] add common function to sleep based on how the test suite is running
Fabio M. Di Nitto [Thu, 26 Sep 2019 05:18:46 +0000 (07:18 +0200)]
[tests] add common function to sleep based on how the test suite is running

Address issue while waiting for host to be up and PMTUd first run.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #258 from kronosnet/wferi/fixes
Fabio M. Di Nitto [Wed, 25 Sep 2019 07:21:59 +0000 (09:21 +0200)]
Merge pull request #258 from kronosnet/wferi/fixes

Assorted small fixups

4 years agoFix typo: trasport -> transport
Ferenc Wágner [Wed, 29 May 2019 09:42:08 +0000 (11:42 +0200)]
Fix typo: trasport -> transport

Signed-off-by: Ferenc Wágner <wferi@debian.org>
4 years agotests: skip the SCTP test if SCTP is not supported by the kernel
Ferenc Wágner [Wed, 3 Apr 2019 08:26:11 +0000 (10:26 +0200)]
tests: skip the SCTP test if SCTP is not supported by the kernel

For example, module loading is disabled on Debian build daemons.
(In the vein of c5aa1c3343703455b480cef5c173f471e1bb020f.)

Signed-off-by: Ferenc Wágner <wferi@debian.org>
4 years agoMerge pull request #257 from kronosnet/netload-fixes
Fabio M. Di Nitto [Thu, 19 Sep 2019 11:32:02 +0000 (13:32 +0200)]
Merge pull request #257 from kronosnet/netload-fixes

[links] fix memory corryption of link structure

4 years ago[links] fix memory corryption of link structure
Fabio M. Di Nitto [Thu, 19 Sep 2019 07:02:44 +0000 (09:02 +0200)]
[links] fix memory corryption of link structure

the index would overflow the buffer and overwrite data in the link
structure. Depending on what was written the cluster could fall
apart in many ways, from crashing, to hung.

Fixes: https://github.com/kronosnet/kronosnet/issues/255
thanks to the proxmox developers and community for reporting the issue
and for all the help reproducing / debugging the problem.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #254 from kronosnet/test-fixes
Fabio M. Di Nitto [Fri, 13 Sep 2019 11:09:00 +0000 (13:09 +0200)]
Merge pull request #254 from kronosnet/test-fixes

Test fixes

4 years ago[tests] give PMTUd more time to redetect MTU
Fabio M. Di Nitto [Fri, 13 Sep 2019 05:30:06 +0000 (07:30 +0200)]
[tests] give PMTUd more time to redetect MTU

Ideal fix would be to use PMTUd callback, but that requires a lot of
extra test infrastructure. For now just workaround the problem.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[tests] fix ip generation boundaries
Fabio M. Di Nitto [Fri, 13 Sep 2019 05:28:55 +0000 (07:28 +0200)]
[tests] fix ip generation boundaries

https://ci.kronosnet.org/job/knet-build-all-voting/1450/knet-build-all-voting=rhel80z-s390x/console

and similar, when pid = 255, the secondary IP would hit 256 that is of course invalid.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #253 from kronosnet/bsd-fixes
Fabio M. Di Nitto [Thu, 12 Sep 2019 15:55:03 +0000 (17:55 +0200)]
Merge pull request #253 from kronosnet/bsd-fixes

[nozzle] fix tapX range on newer FreeBSD

4 years ago[nozzle] fix tapX range on newer FreeBSD
Fabio M. Di Nitto [Thu, 12 Sep 2019 04:01:38 +0000 (06:01 +0200)]
[nozzle] fix tapX range on newer FreeBSD

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #252 from kronosnet/lock-fix
Fabio M. Di Nitto [Tue, 10 Sep 2019 07:19:43 +0000 (09:19 +0200)]
Merge pull request #252 from kronosnet/lock-fix

[pmtud] switch to use async version of dstcache update due to locking…

4 years ago[pmtud] switch to use async version of dstcache update due to locking context (read...
Fabio M. Di Nitto [Mon, 9 Sep 2019 13:11:25 +0000 (15:11 +0200)]
[pmtud] switch to use async version of dstcache update due to locking context (read vs write)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #251 from kronosnet/latency-fixes
Fabio M. Di Nitto [Mon, 9 Sep 2019 03:35:59 +0000 (05:35 +0200)]
Merge pull request #251 from kronosnet/latency-fixes

[links] stabilize latency calculation when nodes are not responsive

4 years ago[links] stabilize latency calculation when nodes are not responsive
Fabio M. Di Nitto [Fri, 6 Sep 2019 05:05:19 +0000 (07:05 +0200)]
[links] stabilize latency calculation when nodes are not responsive

The following scenario is more of a corner case than normal, but
this change allows to better deal with this situation:

1) 2 nodes cluster (corosync) (node A and node B)
2) kill -stop $(pidof corosync) on node A
3) node B will continue to send ping packets to node A
4) node A is accumulating those ping packets in the kernel network socket
5) wait some seconds and unpause node A
6) node A will start processing the ping packets in the queue
   and send pong replies to node B
7) node B will see an extreme increase of latency due
   those "obsoleted" ping/pong packets
8) node B, as latency increases, will take longer and longer
   to notice that node A is down due to the pong_timeout adjustment
   for latency (required for initial cluster spike).

the solution:

1) Use average latency to calculate pong_timeout_adj vs latency_max.
   Averate latency will go down again in time, while latency_max is never
   reset.

2) RX thread will filter out all pong packets that have higher latency
   than currently configure pong_timeout. This barrier should have
   been in place even before.

this solution reduces the latency spike on node B to a perfectly
reasonable level and it will all eventually stabilize over time
as latency samples increase and latency will reduce.

Please be aware that using a pong_timeout smaller than latency will
simply mark the link down now.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #250 from jfriesse/musl_fix
Fabio M. Di Nitto [Tue, 3 Sep 2019 10:12:28 +0000 (12:12 +0200)]
Merge pull request #250 from jfriesse/musl_fix

Fix compilation and running on Linux distribution with musl libc

4 years ago[handle] Set thread stack size on create
Jan Friesse [Mon, 2 Sep 2019 11:56:34 +0000 (13:56 +0200)]
[handle] Set thread stack size on create

Musl libc has small stack size for threads. Knet needs ~300KiB (tested
at the time when this patch was created). Glibc seems to use ~8MiB. As a
compromise, 1MiB is used.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years ago[common] Conditionalize RTLD_DI_ORIGIN
Jan Friesse [Mon, 2 Sep 2019 09:11:27 +0000 (11:11 +0200)]
[common] Conditionalize RTLD_DI_ORIGIN

RTLD_DI_ORIGIN is used to get absolute path of plugin. It is used only
for logging useful info and not strictly needed, so use it only when it
is defined (only musl is known to author of the patch)

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years ago[common] Include correct errno.h
Jan Friesse [Mon, 2 Sep 2019 08:05:18 +0000 (10:05 +0200)]
[common] Include correct errno.h

sys/errno.h is system-specific path and errno.h should be used instead.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoMerge pull request #248 from jfriesse/fix-prio-description
Fabio M. Di Nitto [Tue, 27 Aug 2019 07:25:20 +0000 (09:25 +0200)]
Merge pull request #248 from jfriesse/fix-prio-description

[man] Fix priority description of POLICY_PASSIVE

4 years ago[man] Fix priority description of POLICY_PASSIVE
Jan Friesse [Mon, 26 Aug 2019 13:41:23 +0000 (15:41 +0200)]
[man] Fix priority description of POLICY_PASSIVE

... to match source code.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
4 years agoMerge pull request #245 from kronosnet/pmtud-fixes
Fabio M. Di Nitto [Wed, 21 Aug 2019 04:17:33 +0000 (06:17 +0200)]
Merge pull request #245 from kronosnet/pmtud-fixes

[PMTUd] rework the whole math to calculate MTU

4 years ago[PMTUd] add ability to manually override MTU and disable PMTUd
Fabio M. Di Nitto [Tue, 20 Aug 2019 04:57:45 +0000 (06:57 +0200)]
[PMTUd] add ability to manually override MTU and disable PMTUd

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[PMTUd] add dynamic pong timeout when using crypto
Fabio M. Di Nitto [Tue, 13 Aug 2019 04:41:32 +0000 (06:41 +0200)]
[PMTUd] add dynamic pong timeout when using crypto

problem originally reported by proxmox community, users
observed that under pressure the MTU would flap back and forth
between 2 values due to other node response timeout.

implement a dynamic timeout multiplier when using crypto that
should solve the problem in a more flexible fashion.

When a timeout hits, those new logs will show:

[knet]: [info] host: host: 1 (passive) best link: 0 (pri: 0)
[knet]: [debug] pmtud: Starting PMTUD for host: 1 link: 0
[knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (4) for host 1 link: 0
[knet]: [info] pmtud: PMTUD link change for host: 1 link: 0 from 469 to 65429
[knet]: [debug] pmtud: PMTUD completed for host: 1 link: 0 current link mtu: 65429
[knet]: [info] pmtud: Global data MTU changed to: 65429
[knet]: [debug] pmtud: Starting PMTUD for host: 1 link: 0
[knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (8) for host 1 link: 0
[knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (16) for host 1 link: 0
[knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (32) for host 1 link: 0
[knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (64) for host 1 link: 0
[knet]: [debug] pmtud: PMTUD completed for host: 1 link: 0 current link mtu: 65429
[knet]: [debug] pmtud: Starting PMTUD for host: 1 link: 0
[knet]: [debug] pmtud: Increasing PMTUd response timeout multiplier to (128) for host 1 link: 0
[knet]: [debug] pmtud: PMTUD completed for host: 1 link: 0 current link mtu: 65429

and when the latency reduces and it is safe to be more responsive again:

[knet]: [debug] pmtud: Starting PMTUD for host: 1 link: 0
[knet]: [debug] pmtud: Decreasing PMTUd response timeout multiplier to (64) for host 1 link: 0
[knet]: [debug] pmtud: PMTUD completed for host: 1 link: 0 current link mtu: 65429

....

testing this patch on normal hosts is a bit challenging tho.

Patch was tested by hardcoding a super low timeout here:

diff --git a/libknet/threads_pmtud.c b/libknet/threads_pmtud.c
index 4f0ba0f..5e2b89b 100644
--- a/libknet/threads_pmtud.c
+++ b/libknet/threads_pmtud.c
@@ -261,7 +271,8 @@ retry:
                        /*
                         * crypto, under pressure, is a royal PITA
                         */
-                       pong_timeout_adj_tmp = dst_link->pong_timeout_adj * 2;
+                       //pong_timeout_adj_tmp = dst_link->pong_timeout_adj * dst_link->pmtud_crypto_timeout_multiplier;
+                       pong_timeout_adj_tmp = 30 * dst_link->pmtud_crypto_timeout_multiplier;
                } else {
                        pong_timeout_adj_tmp = dst_link->pong_timeout_adj;
                }

and using a long running version of api_knet_send_crypto_test with a short PMTUd setfreq (10 sec).

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[PMTUd] rework the whole math to calculate MTU
Fabio M. Di Nitto [Mon, 12 Aug 2019 14:52:59 +0000 (16:52 +0200)]
[PMTUd] rework the whole math to calculate MTU

internal changes:
- drop the concept of sec_header_size that was completely wrong
  and unnecessary
- bump crypto API to version 3 due to the above change
- clarify the difference between link->proto_overhead and
  link->status->proto_overhead. We cannot rename the status
  one as it would also change ABI.
- add onwire.c with documentation on the packet format
  and what various len(s) mean in context.
- add 3 new functions to calculate MTUs back and forth
  and use them around, hopefully with enough clarification
  on why things are done in a given way.
- heavily change thread_pmtud.c to use those new facilities.
- fix major calculation issues when using crypto (non-crypto
  was not affected by the problem).
- fix checks around to make sure they match the new math.
- fix padding calculation.
- add functional PMTUd crypto test
  this test can take several hours (12+) and should be executed
  on a controlled environment since it automatically changes
  loopback MTU to run tests.
- fix way the lowest MTU is calculated during a PMTUd run
  to avoid spurious double notifications.
- drop redundant checks.

user visible changes:
- Global MTU is now calculated properly when using crypto
  and values will be in general bigger than before due
  to incorrect padding calculation in the previous implementation.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #242 from kronosnet/pmtud-fixes
Fabio M. Di Nitto [Fri, 2 Aug 2019 11:22:45 +0000 (13:22 +0200)]
Merge pull request #242 from kronosnet/pmtud-fixes

Pmtud fixes

4 years ago[PMTUd] fix MTU calculation when using crypto and add docs
Fabio M. Di Nitto [Fri, 2 Aug 2019 08:44:23 +0000 (10:44 +0200)]
[PMTUd] fix MTU calculation when using crypto and add docs

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[docs] add knet packet layout
Fabio M. Di Nitto [Fri, 2 Aug 2019 08:43:09 +0000 (10:43 +0200)]
[docs] add knet packet layout

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[udp] log information about detected kernel MTU
Fabio M. Di Nitto [Wed, 31 Jul 2019 12:15:07 +0000 (14:15 +0200)]
[udp] log information about detected kernel MTU

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[crypto] fix log information
Fabio M. Di Nitto [Tue, 30 Jul 2019 09:18:33 +0000 (11:18 +0200)]
[crypto] fix log information

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #240 from kronosnet/cov-scan
Fabio M. Di Nitto [Fri, 26 Jul 2019 13:07:32 +0000 (15:07 +0200)]
Merge pull request #240 from kronosnet/cov-scan

coverity scan fixes

4 years ago[sctp] retry locking in case of failure
Fabio M. Di Nitto [Fri, 26 Jul 2019 07:58:05 +0000 (09:58 +0200)]
[sctp] retry locking in case of failure

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[tx] clean up channel management code for internal communications
Fabio M. Di Nitto [Thu, 25 Jul 2019 09:18:19 +0000 (11:18 +0200)]
[tx] clean up channel management code for internal communications

the code is still not in use but it's more clear and doesn't trigger
memory overrun

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[nozzle] fix a few coverity errors in the test suite
Fabio M. Di Nitto [Thu, 25 Jul 2019 07:24:26 +0000 (09:24 +0200)]
[nozzle] fix a few coverity errors in the test suite

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[tx] drop unnecessary usleep when sending to localhost
Fabio M. Di Nitto [Thu, 25 Jul 2019 06:28:34 +0000 (08:28 +0200)]
[tx] drop unnecessary usleep when sending to localhost

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[common] make sure string is null terminated
Fabio M. Di Nitto [Wed, 24 Jul 2019 11:59:47 +0000 (13:59 +0200)]
[common] make sure string is null terminated

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[test] simplify flush log
Fabio M. Di Nitto [Wed, 24 Jul 2019 11:46:51 +0000 (13:46 +0200)]
[test] simplify flush log

allocate on stack only once and make sure strings are null terminated
drop useless read loop since log msg are always smaller than PAGE_SIZE
and read are atomic at that level

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[nozzle] avoid tons of possible buffer overruns
Fabio M. Di Nitto [Wed, 24 Jul 2019 09:00:00 +0000 (11:00 +0200)]
[nozzle] avoid tons of possible buffer overruns

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[PMTUd] do not double unlock global read lock
Fabio M. Di Nitto [Wed, 24 Jul 2019 06:38:56 +0000 (08:38 +0200)]
[PMTUd] do not double unlock global read lock

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[coverity] add test targets to run coverity automatically
Fabio M. Di Nitto [Tue, 23 Jul 2019 07:15:15 +0000 (09:15 +0200)]
[coverity] add test targets to run coverity automatically

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[compress] do not overrun allocated array for compress modules
Fabio M. Di Nitto [Thu, 18 Jul 2019 13:39:57 +0000 (15:39 +0200)]
[compress] do not overrun allocated array for compress modules

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[logging] make sure not to overrun buffers by pre-allocating them
Fabio M. Di Nitto [Thu, 18 Jul 2019 11:31:32 +0000 (13:31 +0200)]
[logging] make sure not to overrun buffers by pre-allocating them

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[compress] don't leak memory in case of errors during zstd init
Fabio M. Di Nitto [Thu, 18 Jul 2019 11:12:36 +0000 (13:12 +0200)]
[compress] don't leak memory in case of errors during zstd init

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[nozzle] don't leak memory on error
Fabio M. Di Nitto [Thu, 18 Jul 2019 11:09:05 +0000 (13:09 +0200)]
[nozzle] don't leak memory on error

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[nozzle] fix negative return detected by coverity scan
Fabio M. Di Nitto [Thu, 18 Jul 2019 11:04:54 +0000 (13:04 +0200)]
[nozzle] fix negative return detected by coverity scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[sctp] cleanup bugs detected in error paths by coverity scan
Fabio M. Di Nitto [Thu, 18 Jul 2019 09:57:36 +0000 (11:57 +0200)]
[sctp] cleanup bugs detected in error paths by coverity scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[acl] avoid forward null deferencing
Fabio M. Di Nitto [Thu, 18 Jul 2019 09:08:32 +0000 (11:08 +0200)]
[acl] avoid forward null deferencing

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[rx] better error report if we can't resolve hostname / port
Fabio M. Di Nitto [Thu, 18 Jul 2019 08:43:58 +0000 (10:43 +0200)]
[rx] better error report if we can't resolve hostname / port

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[common] fix dlopen error handling
Fabio M. Di Nitto [Thu, 18 Jul 2019 08:36:43 +0000 (10:36 +0200)]
[common] fix dlopen error handling

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[tests] fix knet_bench coverity errors
Fabio M. Di Nitto [Thu, 18 Jul 2019 08:23:14 +0000 (10:23 +0200)]
[tests] fix knet_bench coverity errors

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[sctp] revalidate fd to make coverity scan happy
Fabio M. Di Nitto [Thu, 18 Jul 2019 05:59:01 +0000 (07:59 +0200)]
[sctp] revalidate fd to make coverity scan happy

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[handle] make sure that the pmtud buf contains at least knet header size
Fabio M. Di Nitto [Thu, 18 Jul 2019 05:50:37 +0000 (07:50 +0200)]
[handle] make sure that the pmtud buf contains at least knet header size

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[rx] align data types
Fabio M. Di Nitto [Thu, 18 Jul 2019 05:11:56 +0000 (07:11 +0200)]
[rx] align data types

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[sctp] free access list only if the socket is valid
Fabio M. Di Nitto [Thu, 18 Jul 2019 05:03:11 +0000 (07:03 +0200)]
[sctp] free access list only if the socket is valid

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[sctp] fix deference after null check
Fabio M. Di Nitto [Mon, 15 Jul 2019 13:10:15 +0000 (15:10 +0200)]
[sctp] fix deference after null check

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #238 from kronosnet/coverity_scan
Fabio M. Di Nitto [Wed, 17 Jul 2019 08:56:21 +0000 (10:56 +0200)]
Merge pull request #238 from kronosnet/coverity_scan

[coverity] add .travis.yml to integrate CI with coverity scan

4 years ago[coverity] add .travis.yml to integrate CI with coverity scan
Fabio M. Di Nitto [Wed, 17 Jul 2019 07:41:20 +0000 (09:41 +0200)]
[coverity] add .travis.yml to integrate CI with coverity scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #236 from kronosnet/queue-flush
Fabio M. Di Nitto [Fri, 28 Jun 2019 09:33:40 +0000 (11:33 +0200)]
Merge pull request #236 from kronosnet/queue-flush

[threads] allow knet_handle_setfwd to flush socket queues

4 years ago[threads] allow knet_handle_setfwd to flush socket queues
Fabio M. Di Nitto [Thu, 27 Jun 2019 08:55:23 +0000 (10:55 +0200)]
[threads] allow knet_handle_setfwd to flush socket queues

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #235 from kronosnet/minor-cleanup
Fabio M. Di Nitto [Wed, 26 Jun 2019 08:38:04 +0000 (10:38 +0200)]
Merge pull request #235 from kronosnet/minor-cleanup

Minor cleanup

4 years ago[compress] fix #if def around BZIP2 testing
Fabio M. Di Nitto [Wed, 26 Jun 2019 03:31:23 +0000 (05:31 +0200)]
[compress] fix #if def around BZIP2 testing

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[compress] fix a few minor space vs tab and code formatting
Fabio M. Di Nitto [Wed, 26 Jun 2019 03:31:06 +0000 (05:31 +0200)]
[compress] fix a few minor space vs tab and code formatting

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #233 from ReyRen/compression_default_level
Fabio M. Di Nitto [Wed, 26 Jun 2019 03:11:18 +0000 (05:11 +0200)]
Merge pull request #233 from ReyRen/compression_default_level

[compress]Default compress level use

4 years ago[compress]Default compression level use
yuan ren [Tue, 25 Jun 2019 13:55:26 +0000 (21:55 +0800)]
[compress]Default compression level use

1. add test casees for a module without default.Using default
compression level.
2. Discuss with Fabio, invalid compression level not the knet
responsible for, so error logged. But if compress success but
dstLen larger than srcLen, defualt compression level will be
used, because the request level is not effective.

Signed-off-by: yuan ren <yren@suse.com>
4 years ago[tests] ignore libnss errors from OpenSuse Tumbleweed
Fabio M. Di Nitto [Tue, 25 Jun 2019 11:30:23 +0000 (13:30 +0200)]
[tests] ignore libnss errors from OpenSuse Tumbleweed

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoDefault compress level use
yuan ren [Mon, 17 Jun 2019 11:58:20 +0000 (19:58 +0800)]
Default compress level use

Discuss with Fabio, invalid compression level not the knet
responsible for, so error logged. But if compress success but
dstLen larger than srcLen, defualt compression level will be
used, because the request level is not effective.

Signed-off-by: yuan ren <yren@suse.com>
4 years agoMerge pull request #231 from kronosnet/nss-opensuse
Fabio M. Di Nitto [Mon, 17 Jun 2019 07:24:52 +0000 (09:24 +0200)]
Merge pull request #231 from kronosnet/nss-opensuse

[tests] ignore libnss errors from OpenSuse 15

4 years ago[tests] ignore libnss errors from OpenSuse 15
Fabio M. Di Nitto [Sun, 16 Jun 2019 05:41:49 +0000 (07:41 +0200)]
[tests] ignore libnss errors from OpenSuse 15

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #230 from kronosnet/minor
Fabio M. Di Nitto [Wed, 12 Jun 2019 05:33:13 +0000 (07:33 +0200)]
Merge pull request #230 from kronosnet/minor

copyright and licence update

4 years ago[global] update copyrights
Fabio M. Di Nitto [Wed, 12 Jun 2019 03:23:47 +0000 (05:23 +0200)]
[global] update copyrights

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[global] clarify license entry per file to match README.licence
Fabio M. Di Nitto [Wed, 12 Jun 2019 03:21:24 +0000 (05:21 +0200)]
[global] clarify license entry per file to match README.licence

libraries code: LGPL-2.0+
binaries code and other files: GPL-2.0+

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #229 from kronosnet/openssl-fixes
Fabio M. Di Nitto [Tue, 11 Jun 2019 14:06:16 +0000 (16:06 +0200)]
Merge pull request #229 from kronosnet/openssl-fixes

Openssl fixes

4 years ago[crypto] hide errors generated by openssl 1.1.1c
Fabio M. Di Nitto [Tue, 11 Jun 2019 09:54:08 +0000 (11:54 +0200)]
[crypto] hide errors generated by openssl 1.1.1c

see also:
https://github.com/kronosnet/kronosnet/issues/226
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930061#12

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years ago[crypto] openssl: drop calls to RAND_seed as they don´t really help RNG
Fabio M. Di Nitto [Tue, 11 Jun 2019 07:26:02 +0000 (09:26 +0200)]
[crypto] openssl: drop calls to RAND_seed as they don´t really help RNG

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930061#12 for reference

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
4 years agoMerge pull request #227 from ReyRen/openssl-error-mem-free
Fabio M. Di Nitto [Thu, 6 Jun 2019 15:26:44 +0000 (17:26 +0200)]
Merge pull request #227 from ReyRen/openssl-error-mem-free

[crypto]openssl error strings release

4 years ago[crypto]openssl error strings release
yuan ren [Thu, 6 Jun 2019 05:46:01 +0000 (13:46 +0800)]
[crypto]openssl error strings release

In versions prior to OpenSSL 1.1.0, ERR_free_strings() releases
any resources created by ERR_load_crypto_strings.

Signed-off-by: yuan ren <yren@suse.com>
5 years agoMerge pull request #225 from kronosnet/ssl-reconf
Fabio M. Di Nitto [Mon, 3 Jun 2019 14:53:50 +0000 (16:53 +0200)]
Merge pull request #225 from kronosnet/ssl-reconf

Ssl reconf

5 years ago[crypto] fix openssl1.0 initialization code
Fabio M. Di Nitto [Tue, 28 May 2019 04:14:29 +0000 (06:14 +0200)]
[crypto] fix openssl1.0 initialization code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years ago[PMTUd] extend internal rerun API to allow full PMTUd reset
Fabio M. Di Nitto [Tue, 28 May 2019 03:35:24 +0000 (05:35 +0200)]
[PMTUd] extend internal rerun API to allow full PMTUd reset

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years ago[crypto] rework knet_handle_crypto external API to be more solid
Fabio M. Di Nitto [Tue, 28 May 2019 03:24:47 +0000 (05:24 +0200)]
[crypto] rework knet_handle_crypto external API to be more solid

the API was rather weak and could potentially leave traffic uncrypted
in case of certain, corner case, failures.

this patch is a subset of a bigger rework of the crypto layer that
will in future allow runtime reconfiguration without traffic disruption
of the crypto config.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years ago[crypto] make sure to trigger a PMTUd rerun on each good crypto config change
Fabio M. Di Nitto [Mon, 27 May 2019 10:42:33 +0000 (12:42 +0200)]
[crypto] make sure to trigger a PMTUd rerun on each good crypto config change

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years ago[PMTUd] create common/shared code to trigger PMTUd rerun
Fabio M. Di Nitto [Mon, 27 May 2019 10:37:15 +0000 (12:37 +0200)]
[PMTUd] create common/shared code to trigger PMTUd rerun

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years ago[crypto] make sure to clear all security info on crypto_fini
Fabio M. Di Nitto [Mon, 27 May 2019 10:25:55 +0000 (12:25 +0200)]
[crypto] make sure to clear all security info on crypto_fini

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years agoMerge pull request #224 from kronosnet/covscan3
Fabio M. Di Nitto [Mon, 27 May 2019 03:25:55 +0000 (05:25 +0200)]
Merge pull request #224 from kronosnet/covscan3

misc: Fix more covscan warnings

5 years agomisc: Fix more covscan warnings
Christine Caulfield [Fri, 24 May 2019 09:09:47 +0000 (10:09 +0100)]
misc: Fix more covscan warnings

The only serious bug here is in transport_udp.c
(see bottom of patch), the rest are mostly detail.

covscan still reports a lot of errors against doxyxml, most of
which are because it doesn't understand the libqb hashtables.

5 years agoMerge pull request #222 from kronosnet/covscan-fixes2
Fabio M. Di Nitto [Mon, 20 May 2019 11:38:00 +0000 (13:38 +0200)]
Merge pull request #222 from kronosnet/covscan-fixes2

misc: some coverity fixes

5 years agomisc: some coverity fixes
Christine Caulfield [Fri, 17 May 2019 07:44:08 +0000 (08:44 +0100)]
misc: some coverity fixes

In rough order of seriousness:

1. Fix clock_gettime() in pmtud so that it's always called, as
   variable 'clock_now' is always read.
2. Allow space for trailing NUL in libnozzle device names
3. Fix api_nozzle_run_updown_test so it can run out of the build tree
4. Disallow a 0 length prefix in libnozzle
5. Fix potential use of NULL pointer on doxyxml
6. Free 'name' in doxyxml as it's *not* in the map any more
7. Fix dead code in libknet API functions left by code changes

5 years agoMerge pull request #220 from kronosnet/specfile
Fabio M. Di Nitto [Thu, 16 May 2019 18:26:38 +0000 (20:26 +0200)]
Merge pull request #220 from kronosnet/specfile

Specfile update

5 years ago[spec] use ldconfig_scriptlets only when defined
Fabio M. Di Nitto [Tue, 14 May 2019 04:57:36 +0000 (06:57 +0200)]
[spec] use ldconfig_scriptlets only when defined

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years ago[spec] drop support for init scripts
Fabio M. Di Nitto [Tue, 14 May 2019 03:53:12 +0000 (05:53 +0200)]
[spec] drop support for init scripts

no rpm distros left that support old fashion init scripts

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years ago[spec] fix a bunch of rpmlint errors
Fabio M. Di Nitto [Mon, 13 May 2019 04:55:36 +0000 (06:55 +0200)]
[spec] fix a bunch of rpmlint errors

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
5 years ago[spec] reconciliate fedora spec file into upstream spec file (part 1)
Fabio M. Di Nitto [Mon, 13 May 2019 04:02:06 +0000 (06:02 +0200)]
[spec] reconciliate fedora spec file into upstream spec file (part 1)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>