Commit 6ccf64c
stress-ovpn: drive the remaining peer-delete reasons
The module reports why each peer was removed, and the five reasons come
from genuinely different code paths. The churn was reaching only three:
USERSPACE from deleting a peer, TRANSPORT_DISCONNECT from closing the
transport, TEARDOWN when the interface goes away. EXPIRED and
TRANSPORT_ERROR were never produced, so two teardown paths went untested
while everything appeared covered - and both are worth reaching
deliberately, since ovpn_tcp_peer_del_work() is where both of the bugs
this stressor has found so far lived.
EXPIRED comes from ovpn_peer_keepalive_work(), which needs both
keepalive values non-zero and no traffic received for the timeout. The
live peer never qualifies, traffic keeps arriving, and the random
timeouts of up to 255s outlive any cycle. A phantom peer receives
nothing by construction, so a two second timeout expires it within the
cycle without having to orchestrate a pause in the traffic the live peer
depends on.
Setting the keepalive through PEER_NEW turned out not to be enough.
ovpn_nl_peer_new_doit() applies the attributes before adding the peer to
the table, and applying them arms the worker with a zero delay, so it
runs while the peer is still invisible, finds no expiry to wait for, and
only rearms itself when it found one. A peer whose keepalive arrived
with PEER_NEW alone can therefore end up configured with nothing
checking it. It is also sent a PEER_SET, which arms the worker with the
peer present - the state a daemon reaches by setting keepalive after
creating the peer.
TRANSPORT_ERROR comes from ovpn_tcp_peer_del_work(), reached when the
TCP stream cannot be parsed. ovpn frames its TCP transport with a length
prefix and feeds the socket to a strparser, so writing raw bytes onto
the transport makes that prefix nonsense and the module tears the peer
down. UDP has no framing to corrupt, so the new case is TCP only.
Signed-off-by: Gianmarco De Gregori <gianmarco@mandelbit.com>1 parent f3383f1 commit 6ccf64c
1 file changed
Lines changed: 76 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1808 | 1808 | | |
1809 | 1809 | | |
1810 | 1810 | | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
1811 | 1833 | | |
1812 | 1834 | | |
1813 | 1835 | | |
| |||
2226 | 2248 | | |
2227 | 2249 | | |
2228 | 2250 | | |
2229 | | - | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
2230 | 2277 | | |
2231 | 2278 | | |
2232 | 2279 | | |
| |||
2373 | 2420 | | |
2374 | 2421 | | |
2375 | 2422 | | |
2376 | | - | |
| 2423 | + | |
2377 | 2424 | | |
2378 | 2425 | | |
2379 | 2426 | | |
| |||
2438 | 2485 | | |
2439 | 2486 | | |
2440 | 2487 | | |
| 2488 | + | |
2441 | 2489 | | |
2442 | 2490 | | |
2443 | 2491 | | |
| |||
2503 | 2551 | | |
2504 | 2552 | | |
2505 | 2553 | | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
2506 | 2579 | | |
2507 | 2580 | | |
2508 | 2581 | | |
| |||
2848 | 2921 | | |
2849 | 2922 | | |
2850 | 2923 | | |
| 2924 | + | |
2851 | 2925 | | |
2852 | 2926 | | |
2853 | 2927 | | |
| |||
0 commit comments