As long as there is no mature test suite for the library, only a test
in production could show failures. Tests must contain a huge workload
of active connections and various, unusual protocols.
No commit before test suite is complete.
```
1_instance:1_singleinit -> passed [0.003s]
1_instance:2_destroynull -> expected_failure: Code expects valid pointer. [0.013s]
1_instance:3_multiinit -> passed [0.005s]
1_instance:4_multiinstance -> passed [0.037s]
2_natout:1_simplemasq -> passed [0.003s]
2_natout:2_unregistered -> passed [0.003s]
2_natout:3_cgn -> passed [0.004s]
2_natout:4_udp -> passed [0.003s]
2_natout:5_sameport -> passed [0.003s]
2_natout:6_cleartable -> passed [0.003s]
2_natout:7_stress -> passed [0.048s]
3_natin:1_portforward -> passed [0.003s]
3_natin:2_portoverlap -> passed [0.003s]
3_natin:3_redirectany -> passed [0.003s]
3_natin:4_redirectaddr -> passed [0.003s]
3_natin:5_lsnat -> passed [0.003s]
3_natin:6_oneshot -> passed [0.003s]
```
Performance before this patch:
```
Running perfomance test with parameters:
Maximum Runtime (max_seconds) = 10
Amount of valid connections (batch_size) = 2000
Amount of random, incoming packets (batch_size) = 1000
Repeat count of a random, incoming packet (attack_size) = 1000
Amount of open port forwardings (redir_size) = 2000
RND SECOND newNAT RANDOM ATTACK useNAT
1 0.0 0.59 0.18 0.06 0.10
2 0.0 0.66 0.16 0.06 0.11
3 0.0 0.77 0.20 0.06 0.11
4 0.1 0.85 0.25 0.06 0.10
5 0.1 0.91 0.23 0.06 0.12
...
135 9.4 54.76 16.33 1.24 0.10
136 9.6 54.52 16.50 0.97 0.10
137 9.7 56.18 16.97 1.11 0.10
138 9.8 58.04 16.60 1.23 0.11
139 10.0
Results
Rounds : 138
newNAT ok : 276410
newNAT fail: 0
useNAT ok : 2282413 (out)
useNAT fail: 0 (out)
useNAT ok : 18462687 (in)
useNAT fail: 0 (in)
RANDOM ok : 1806
RANDOM fail: 136194
ATTACK ok : 0
ATTACK fail: 138000
---------
Total: 21297510
```
And now:
```
Running perfomance test with parameters:
Maximum Runtime (max_seconds) = 10
Amount of valid connections (batch_size) = 2000
Amount of random, incoming packets (batch_size) = 1000
Repeat count of a random, incoming packet (attack_size) = 1000
Amount of open port forwardings (redir_size) = 2000
RND SECOND newNAT RANDOM ATTACK useNAT
1 0.0 0.59 0.14 0.06 0.10
2 0.0 0.71 0.14 0.05 0.10
3 0.0 0.78 0.17 0.06 0.11
4 0.1 0.90 0.18 0.06 0.11
5 0.1 0.95 0.18 0.06 0.10
...
145 9.6 52.49 1.80 0.11 0.17
146 9.7 51.62 1.91 0.13 0.19
147 9.8 48.77 1.87 0.13 0.17
148 10.0
Results
Rounds : 147
newNAT ok : 295178
newNAT fail: 0
useNAT ok : 2431666 (out)
useNAT fail: 0 (out)
useNAT ok : 19669446 (in)
useNAT fail: 0 (in)
RANDOM ok : 1940
RANDOM fail: 145060
ATTACK ok : 0
ATTACK fail: 147000
---------
Total: 22690290
```