| 1 |
librist - Reliable Internet Stream Transport |
| 2 |
============================================ |
| 3 |
|
| 4 |
A library implementing the Video Services Forum (VSF) Technical |
| 5 |
Recommendations TR-06-1 (Simple Profile), TR-06-2 (Main Profile), |
| 6 |
and TR-06-3 (Advanced Profile). |
| 7 |
|
| 8 |
|
| 9 |
Changes for 0.2.20: |
| 10 |
--------------------------------- |
| 11 |
|
| 12 |
ABI/API: |
| 13 |
- ABI version 16:1:12 (soversion 4, binary-compatible with 0.2.15, |
| 14 |
0.2.16, 0.2.17, 0.2.18, and 0.2.19) |
| 15 |
- API version 4.13.0 (unchanged) |
| 16 |
|
| 17 |
Bug Fixes: |
| 18 |
- ?multiplex-mode= and ?rtp-ptype= are accepted again on udp urls |
| 19 |
(regression in 0.2.19). ristsender refused any url carrying either one, |
| 20 |
and ristsender and ristreceiver stopped applying the multiplex mode they |
| 21 |
were given. |
| 22 |
|
| 23 |
|
| 24 |
Changes for 0.2.19: |
| 25 |
--------------------------------- |
| 26 |
|
| 27 |
ABI/API: |
| 28 |
- ABI version 16:0:12 (soversion 4, binary-compatible with 0.2.15, |
| 29 |
0.2.16, 0.2.17, and 0.2.18) |
| 30 |
- API version 4.13.0 (new features, backwards-compatible) |
| 31 |
|
| 32 |
Features: |
| 33 |
- Receiver output can now be spaced at the stream's own rate instead of |
| 34 |
released in whatever batch the recovery buffer has made due. Intended for |
| 35 |
constant-bitrate streams feeding equipment that recovers a clock from |
| 36 |
arrival timing. Off by default. Set it with |
| 37 |
rist_receiver_set_cbr_output(), with ristreceiver's --cbr-output 0|1, or |
| 38 |
with cbr-output=1 on a udp/rtp output URL (rist_udp_config version 2). |
| 39 |
Pacing never releases a packet early and never holds one past its |
| 40 |
deadline, so enabling it cannot cost packets. The setting applies to the |
| 41 |
whole context rather than per output target, because pacing happens in the |
| 42 |
flow's output loop ahead of the fan-out and all outputs share one release |
| 43 |
schedule; a request for a different value is refused. Spacing is coarser |
| 44 |
on Windows builds without pthreads, whose condition wait cannot express |
| 45 |
sub-millisecond timeouts. |
| 46 |
- Advanced Profile receivers now dejitter off the sender's clock. The |
| 47 |
receive path reconstructs a monotonic source timeline from the 1 MHz |
| 48 |
RTP timestamp (TR-06-3 Section 5.2.1) and stamps packets with it instead |
| 49 |
of local arrival, so output spacing follows the source cadence like the |
| 50 |
Main profile. Reconstruction is wrap-safe (the 32-bit 1 MHz field rolls |
| 51 |
over about every 72 minutes). Because librist releases before this one |
| 52 |
emitted this timestamp on a broken clock, the receiver verifies the |
| 53 |
rebuilt clock over the first second and corrects to arrival timing for |
| 54 |
the rest of the session if it is not advancing at real time (an older, |
| 55 |
non-conformant sender). Set timing-mode=arrival to force arrival. |
| 56 |
- Bonded senders can auto-mute a failing leg by RTT. When a leg's smoothed |
| 57 |
RTT stays above ?rtt-drop=<ms> for ?rtt-drop-settle=<ms>, it is pulled out |
| 58 |
of the weighted payload rotation and its retransmissions are rerouted to a |
| 59 |
healthy leg, so the healthy leg(s) carry 100% of the stream and no traffic |
| 60 |
rides the slow path. It rejoins after RTT stays below ?rtt-restore=<ms> for |
| 61 |
a longer, conservative dwell (asymmetric hysteresis: quick to drop, slow to |
| 62 |
rejoin, so a still-marginal link cannot flap back in). The connection stays |
| 63 |
up and keeps probing RTT while muted; a low-rate redundant trickle |
| 64 |
(?rtt-drop-trickle=<N>, 1-in-N duplicate packets, on by default) keeps the |
| 65 |
muted leg measured so recovery is warm rather than a cold cut-over (set 0 |
| 66 |
for a hard mute). The |
| 67 |
last healthy leg is never muted. Per-leg mute state (rtt_muted) and a |
| 68 |
cumulative mute-event counter (rtt_mute_events) are exposed in the sender |
| 69 |
stats JSON and the Prometheus exporter. Disabled by default (rtt-drop=0); |
| 70 |
no wire change. |
| 71 |
- EAP SHA256-SRP6a gains Version 4: the passphrase pushed over an |
| 72 |
authenticated SRP session is now carried under AES-256-GCM (authenticated |
| 73 |
encryption) instead of the v3 AES-CTR (confidentiality-only) form. Keys are |
| 74 |
per-direction (HKDF-Expand-SHA256 off the SRP session key), the 96-bit |
| 75 |
nonce is monotonic and in-packet, the EAP/SRP header is bound as AAD, and |
| 76 |
the receiver verifies the tag and accepts only strictly-increasing nonces |
| 77 |
before installing. v4 engages only when both peers advertise EAP version 4 |
| 78 |
(a GCM backend is present); a v3/v2 peer falls back to AES-CTR unchanged. |
| 79 |
- TUN tools (risttunnel -l) and rist_tun_set_ip() now accept IPv6 local |
| 80 |
addresses with prefix lengths up to /128 (e.g. fd00::1/64). Linux uses |
| 81 |
rtnetlink RTM_NEWADDR; macOS uses in6_aliasreq. IPv4 behaviour is |
| 82 |
unchanged. |
| 83 |
- rist_oob_read() is now implemented. When out-of-band data is enabled |
| 84 |
without a callback (rist_oob_callback_set with a NULL callback), incoming |
| 85 |
OOB packets are queued and can be drained by polling rist_oob_read(), as |
| 86 |
the public API already documented. The previous stub returned success |
| 87 |
without writing the output pointer, which could crash a polling caller. |
| 88 |
- risttunnel gains a single-port mode (-1/--single-port): a bidirectional |
| 89 |
IP tunnel carried over one UDP port instead of two. A single RIST |
| 90 |
connection runs the forward direction over the RTP data_fd path |
| 91 |
(ARQ-protected) and the reverse direction over the OOB channel on the |
| 92 |
same socket (best-effort, no ARQ). The caller passes only -o, the |
| 93 |
listener only -b. Because librist learns the OOB return peer only from |
| 94 |
received OOB, the listener captures the connecting peer through the |
| 95 |
auth/connect callback and hands it explicitly to rist_oob_write(), while |
| 96 |
the caller injects inbound OOB into its TUN through an OOB receive |
| 97 |
callback. Intended for low-bandwidth, NAT-friendly control tunnels |
| 98 |
where the heavy direction is forward and the reverse is light. |
| 99 |
|
| 100 |
Security audit: |
| 101 |
- Tool and API memory-safety and hygiene. The YAML and SRP-verifier |
| 102 |
parsers no longer over-read or over-write on malformed input; the |
| 103 |
ipv4-mux receiver and the OOB API message handler reject short datagrams |
| 104 |
(were a SIZE_MAX send and an unbounded heap read), and the OOB API |
| 105 |
message is written at the correct byte offset; Prometheus label values |
| 106 |
taken from a peer's SDES cname are escaped (label injection); passphrases |
| 107 |
are no longer logged in clear; derived key material is wiped on every |
| 108 |
path and on key destroy (via a single shared helper); plus several |
| 109 |
NULL-guard, format-string, getopt-width and zero-init fixes. |
| 110 |
- Receiver and Advanced-profile hardening. A zero recovery buffer is |
| 111 |
rejected (was a config-time divide-by-zero SIGFPE); a failed null-packet |
| 112 |
expansion delivers the packet unexpanded instead of stale scratch (and no |
| 113 |
longer feeds SIZE_MAX into the ts-null bitrate stats); Main-profile NACK |
| 114 |
range records are capped per record and per packet (retry-queue DoS |
| 115 |
amplifier); the GRE H bit no longer rewrites a configured key size from |
| 116 |
unauthenticated wire data; state-changing Advanced control messages (NACK, |
| 117 |
RTT echo, flow attributes, PSK future nonce) are honored only after the |
| 118 |
handshake, and the keepalive capability flip is set-only; and the Advanced |
| 119 |
source-clock rate verdict is re-run each window instead of latching arrival |
| 120 |
timing for the whole session. |
| 121 |
- EAP/SRP pre-authentication hardening. Spoofed SERVER_KEY/VALIDATOR |
| 122 |
requests no longer crash an SRP caller on a NULL client context; EAPOL |
| 123 |
START/LOGOFF can no longer reset the brute-force try counter or revive a |
| 124 |
failed context; the passphrase dispatcher keys off the negotiated session |
| 125 |
version, so a v4 (AES-256-GCM) session refuses downgraded v3/derived-key |
| 126 |
frames; the retransmit cache is invalidated only by a matching identifier; |
| 127 |
a reset drops the armed passphrase retransmit to avoid GCM nonce reuse; a |
| 128 |
failed passphrase install is answered with FAILURE instead of a false |
| 129 |
SUCCESS; passphrase push is refused before authentication; wire usernames |
| 130 |
are sanitized before logging (CR/LF injection); and SRP modexp requests |
| 131 |
are rate-limited. |
| 132 |
- PSK key-state hardening. The Advanced future-nonce control message |
| 133 |
carried an unvalidated 16-bit key size that could drive PBKDF2 to write |
| 134 |
past the derived-key stack buffer; it is now rejected at every layer. The |
| 135 |
bad-decryption lockout no longer becomes a one-packet permanent key kill: |
| 136 |
a fresh nonce or passphrase clears it, a valid decrypt decays the strike |
| 137 |
counter, and zero-nonce packets are dropped without latching. The |
| 138 |
PBKDF2-flood protection is preserved as an abuse-triggered per-key rekey |
| 139 |
rate limit, so legitimate nonce churn (including a reflector's RTCP/media |
| 140 |
nonce interleave) is never throttled. |
| 141 |
- URL parsing: a malformed UDP URL no longer triggers an out-of-bounds |
| 142 |
write while extracting the scheme prefix. A URL beginning with '/' |
| 143 |
underflowed the copy length and NUL-padded far past the 16-byte prefix |
| 144 |
buffer; a scheme longer than 15 characters wrote the terminator out of |
| 145 |
bounds. Both the copy length and terminator index are now clamped. |
| 146 |
Reachable via rist_parse_udp_address()/rist_parse_udp_address2() and the |
| 147 |
ristsender/ristreceiver/udp2udp -i/-o URLs. Covered by |
| 148 |
test/rist/unit/test_url_udp_prefix_parse. |
| 149 |
- URL parsing: building the Simple-profile RTCP peer address now uses a |
| 150 |
bounded formatter, so a long input URL cannot overflow the peer-config |
| 151 |
address buffer. |
| 152 |
|
| 153 |
Bug Fixes: |
| 154 |
- librist builds under MSVC again. Three independent breaks, two of which |
| 155 |
stopped the Visual Studio solution outright, so a Windows packaging build |
| 156 |
produced no library, no tools and no installer. The new constant-bitrate |
| 157 |
pacing counter is an atomic_uint_least64_t, a type the bundled MSVC |
| 158 |
stdatomic shim did not declare, which broke rist-private.h and every |
| 159 |
target including it. Separately the EAP authenticator-restart regression |
| 160 |
test pulled in <pthread.h> directly, which does not exist there; it now |
| 161 |
takes the mutex API from the Windows pthread-shim as the other tests do. |
| 162 |
A third, narrower break stopped only the socket-rebind test, which typed |
| 163 |
two sleep durations as useconds_t, a POSIX type MSVC does not provide. |
| 164 |
None of this affects compilers with a native stdatomic.h and real |
| 165 |
pthreads, which is every other supported toolchain. |
| 166 |
- librist now builds against nettle 4.0. The AES-CTR, SRP and EAP v4 code |
| 167 |
used three interfaces that 4.0 removed: the unified struct aes_ctx, and |
| 168 |
the length argument on the sha256, hmac-sha256 and gcm digest calls. A |
| 169 |
build configured for nettle (?use_nettle=true, which is what distributions |
| 170 |
and VLC's contrib select over the bundled mbedtls) failed to compile |
| 171 |
outright. nettle 3.x is still supported; the digest calls are selected on |
| 172 |
NETTLE_VERSION_MAJOR. No behaviour change on any backend. |
| 173 |
- CBR output pacing now spreads an arrival burst instead of passing most of |
| 174 |
it through. Enabling it used to buy almost nothing: on a 71 Mbps feed the |
| 175 |
output measured 92% of datagrams leaving back to back with pacing on, |
| 176 |
against 94% with it off. The output loop releases on a deadline that every |
| 177 |
packet of an arrival burst shares, so pacing has to hold the rest of the |
| 178 |
burst back, and three things stopped it. The hold that keeps pacing from |
| 179 |
aging a packet out of the recovery buffer was a fixed 1 ms, shorter than |
| 180 |
the time a burst takes to drain at the paced cadence (twelve datagrams at |
| 181 |
that rate need 1.8 ms), so packets past it re-anchored the schedule and |
| 182 |
left together; it now scales with the output jitter bound. A pass with |
| 183 |
nothing to send left the schedule running, banking due times in the past |
| 184 |
that the next arrivals spent as one back-to-back run; such a pass now |
| 185 |
re-anchors. The wake floor was a fixed 250 us against a 148 us datagram |
| 186 |
interval, so a wake found two datagrams due and released the pair; it now |
| 187 |
tracks half the measured interval, clamped to between 20 and 250 us, so a |
| 188 |
stream slow enough that the floor already sits under its interval keeps |
| 189 |
the old wake rate and the old cost. The standard deviation of the output |
| 190 |
spacing goes from 608 us unpaced to 20.4 us, and back-to-back from 94% to |
| 191 |
0.09%, for about two points more of a core on the receiver from the higher |
| 192 |
wake rate. |
| 193 |
- Advanced Profile senders no longer double-count the peer bitrate. The |
| 194 |
Advanced media path accounts p->bw when it builds and sends a packet, |
| 195 |
and the shared send path accounted it a second time, so the measured |
| 196 |
peer bitrate read about 2x the real wire rate. That inflated estimate |
| 197 |
fed the recovery_maxbitrate retransmit throttle, which could refuse |
| 198 |
reactive retransmits while the link was not actually saturated. The |
| 199 |
shared path now skips accounting for Advanced media it did not send. |
| 200 |
- A (re)connecting sender leg now sends its SDES the moment it authenticates, |
| 201 |
instead of waiting for the next periodic RTCP tick. The weighted balancer |
| 202 |
starts forwarding data on a leg as soon as EAP/SRP auth completes, but the |
| 203 |
receiver drops data on a leg until it has seen the SDES that binds the leg |
| 204 |
to the flow. On every reconnect the first data raced ahead of the SDES, so |
| 205 |
the receiver discarded roughly a full RTCP interval of packets ("handshake |
| 206 |
still pending"); this is most visible when a bonded leg flaps repeatedly. |
| 207 |
Emitting the SDES up front closes that window. |
| 208 |
- Bonded legs survive a brief stall without a full re-handshake, and the |
| 209 |
peer liveness timeout is now principled. A leg that went silent was declared |
| 210 |
dead after a hardcoded 250 ms and had to re-run EAP/SRP from cold on return, |
| 211 |
so on a flappy link every RTT spike past 250 ms self-inflicted a re-auth and |
| 212 |
the receiver dropped data on the leg until the handshake rebuilt. Two |
| 213 |
changes fix this. First, routing and session lifetime are split: the sender |
| 214 |
pulls a briefly-silent leg from the payload rotation within a few RTCP |
| 215 |
intervals (rerouting its share and its retransmissions to a healthy sibling), |
| 216 |
while the authenticated session is kept far longer. Second, the teardown is |
| 217 |
the larger of the configured session_timeout and twice the receiver buffer, |
| 218 |
and session_timeout now defaults to the documented RIST_DEFAULT_SESSION_TIMEOUT |
| 219 |
(2000 ms) with a floor of a few RTCP intervals, instead of the old 250 ms; a |
| 220 |
leg that returns within that window resumes on the existing session with no |
| 221 |
re-auth. The last leg with a live return path is never pulled, so a |
| 222 |
single-path stream is never cut. Because a leg can be pulled either for |
| 223 |
high RTT or for silence, the two are reconciled so they never pull every |
| 224 |
leg at once: a leg is muted only while another stays a carrier, and the |
| 225 |
balancer never drops data while a usable leg remains. |
| 226 |
- Senders now really do hold a silent peer for one recovery buffer window |
| 227 |
before dropping it, which is what the fix for #196 was meant to do. A peer |
| 228 |
is declared dead when its return path goes quiet, which says nothing about |
| 229 |
the forward path, so cutting a single-path stream on a late RTCP reply |
| 230 |
strands a receiver that is still fine. Two defects made the grace period |
| 231 |
inert. The window is the peer's recovery buffer, and that was only ever |
| 232 |
computed for receive-side peers, leaving it at zero on every sender. The |
| 233 |
four places that egress payload then tested it backwards, sending to a dead |
| 234 |
peer only once the window had already run out -- and the gate above them had |
| 235 |
already dropped the peer by then, so the window was the one interval in |
| 236 |
which they stayed silent. With a 4 s buffer a single-path sender went quiet |
| 237 |
3 s after the return path died; it now keeps sending for 13 s (twice the |
| 238 |
buffer before the peer is declared dead, then the buffer again as grace). |
| 239 |
Bonded legs are unaffected: a silent leg is pulled from the rotation by the |
| 240 |
stall check long before it is ever declared dead. Populating the buffer on |
| 241 |
send-side peers also makes the sender's liveness timeout match the |
| 242 |
receiver's, instead of always falling back to session_timeout and tearing |
| 243 |
the session down first. |
| 244 |
- RTT auto-mute no longer ping-pongs the stream between two failing legs. |
| 245 |
When every bonded leg was over the ceiling, the leg elected to keep |
| 246 |
carrying was re-picked from the instantaneous RTT on every tick, so with |
| 247 |
both legs oscillating the payload path swapped about once a second -- |
| 248 |
worse for the stream than committing to either leg, and the visible |
| 249 |
remaining glitch on bonded cellular. The role is now sticky: the elected |
| 250 |
leg holds it until it recovers, goes silent, or a sibling measures several |
| 251 |
times better after the incumbent has served at least one drop dwell. The |
| 252 |
mute log also no longer claims the ceiling was crossed when a leg was |
| 253 |
muted while serving out its rejoin dwell. |
| 254 |
- A leg rejoining after an RTT mute ramps its share back up instead of |
| 255 |
resuming at full weight. A muted leg carries almost nothing, so its queue |
| 256 |
drains and it measures well right until it is loaded again; handing back |
| 257 |
the full share at once refilled the queue and re-muted it seconds later, |
| 258 |
which self-oscillated for as long as the link stayed marginal. The share |
| 259 |
now rises linearly over the rejoin dwell, so the leg reveals congestion |
| 260 |
under a growing load and settles at whatever it can actually carry. |
| 261 |
- Senders now report a bandwidth ceiling that leaves no room for |
| 262 |
retransmissions. ?bandwidth= (recovery_maxbitrate) caps payload and |
| 263 |
retransmissions together rather than payload alone, so a ceiling at or |
| 264 |
below the payload rate refuses every NACK for the life of the stream. |
| 265 |
The refusal was logged at debug level only, so what an operator saw was |
| 266 |
a link that never recovered a packet, which reads as a network fault |
| 267 |
rather than a configuration one. A warning now repeats every 30 seconds |
| 268 |
while the condition holds, giving the payload rate, the ceiling and the |
| 269 |
number of refusals in the interval. |
| 270 |
- A recovery_maxbitrate of 0 set through the C API no longer turns recovery |
| 271 |
off. The value looks like "no ceiling" and is what an application reaches |
| 272 |
for when it does not want retransmissions throttled, but the sender read it |
| 273 |
as a ceiling of zero and refused every retransmission for the life of the |
| 274 |
stream, saying so at debug level only. A 0 is now read as unset: it is |
| 275 |
replaced with the 100000 kbps default and warned about, which is how |
| 276 |
?bandwidth=0 on a URL already behaved. Applications that passed 0 meaning |
| 277 |
"unlimited" get the default rather than a stream with no recovery. |
| 278 |
- Receivers no longer rebuild a flow's baseline on a stale packet. When the |
| 279 |
recovery buffer empties, the next packet in sets the flow's clock offset and |
| 280 |
sequence baseline, and any packet would do. A bonded leg queued seconds deep |
| 281 |
keeps delivering packets that old, so on a reset it could win the race and |
| 282 |
rewind the baseline by its whole lag: the next packet from the healthy leg |
| 283 |
then looked like a multi-second jump, which emptied the buffer again. Bonded |
| 284 |
runs showed this repeat until the flow was declared dead, rewinding 12000 |
| 285 |
sequence numbers and 15 seconds of clock in one step. A packet further behind |
| 286 |
the flow's high-water mark than the buffer is deep cannot be output anyway, |
| 287 |
so it is no longer taken as a baseline while a current one may still arrive. |
| 288 |
The wait is capped at one buffer window, so a flow left with nothing but a |
| 289 |
lagged leg, or a source that restarted on a lower clock, still recovers. |
| 290 |
- The trickle on an RTT-muted bonded leg now stops once the leg is queued |
| 291 |
deeper than the receiver's buffer. Past that point nothing sent on it can |
| 292 |
arrive in time to be output, and the arrivals are the stale baseline |
| 293 |
candidates described above. RTCP keeps measuring the leg's RTT, and with no |
| 294 |
payload queued behind them those measurements become honest, so the leg is |
| 295 |
still retried; legs within the buffer window trickle as before. |
| 296 |
- Receiver loss statistics no longer report impossible spikes. The output |
| 297 |
path counted a lost packet for every empty slot it stepped over in the |
| 298 |
recovery ring, which only matches the real loss while the reader sits |
| 299 |
right behind the data; after an idle source or a buffer re-anchor the |
| 300 |
walk spans far more slots than there are missing packets. A clean |
| 301 |
29-minute bonded run reported 40600 packets lost in a one-second window |
| 302 |
whose sequence numbers showed no gap at all, and 12% cumulative loss on |
| 303 |
a stream that never visibly glitched. Loss is now taken from the |
| 304 |
sequence gap, the same measure the nack path already used, so the |
| 305 |
reported and recovered counts agree. |
| 306 |
- Advanced Profile RTT echo replies now feed the smoothed RTT. The reply |
| 307 |
handler recorded the measurement as the peer's last RTT but never folded it |
| 308 |
into the 8-tap average, nor mirrored it onto the data leg where the balancer |
| 309 |
and the stats read it. The value was therefore discarded, and any setup that |
| 310 |
probes RTT only over the Advanced echo would leave the smoothed RTT stuck at |
| 311 |
its seed -- blinding RTT auto-mute and the retransmission timers. In |
| 312 |
practice the Main RTCP receiver reports still refreshed it, so this was |
| 313 |
latent rather than user-visible. The smoothing rule now lives in one place |
| 314 |
shared by every RTT source. |
| 315 |
- Advanced Profile senders now emit a spec-conformant RTP timestamp. The |
| 316 |
1 MHz timestamp (TR-06-3 Section 5.2.1) was built with a >> 16 shift that |
| 317 |
ran the clock 65536x too fast and wrapped every ~65 ms; the sender now |
| 318 |
writes the correct microsecond value on both media data and control |
| 319 |
messages. No librist receiver uses this field (the receive path clocks |
| 320 |
off packet arrival), so only the on-wire value changes; it matters for |
| 321 |
third-party TR-06-3 receivers that read it. |
| 322 |
- Public peer getters no longer crash on NULL arguments (issue #226). |
| 323 |
rist_peer_get_cname() returns 0 when the output pointer is NULL (it |
| 324 |
already guarded the peer), rist_peer_get_id() returns 0 on a NULL peer, |
| 325 |
and rist_peer_get_socket() checks the peer before dereferencing it. |
| 326 |
rist_peer_get_cname() also bounds the returned length with the actual |
| 327 |
cname field size rather than a separate, coincidentally-equal constant. |
| 328 |
- EAP-SRP: a bonded caller-sender leg that goes silent and then resumes on |
| 329 |
the same source tuple (an interface flap or upstream outage that comes |
| 330 |
back without a reconnect) no longer stays wedged (issue #224). While the |
| 331 |
leg was silent the far-end authenticator timed out and purged its session, |
| 332 |
but the caller kept its still-valid miface-bound socket and stayed in EAP |
| 333 |
SUCCESS, so it streamed data the authenticator now dropped while waiting |
| 334 |
for an EAPOL START the caller never sent; the leg never rejoined the bond |
| 335 |
without an operator restart. A caller-sender leg silent past |
| 336 |
session_timeout now resets EAP and re-runs the SRP handshake on its |
| 337 |
existing socket; once it re-authenticates it is folded back into the |
| 338 |
weighted balancing rotation, so it resumes carrying its full share of the |
| 339 |
bond on its own instead of lingering as an authenticated-but-idle leg. |
| 340 |
- EAP-SRP: a caller now re-authenticates on its own after the authenticator |
| 341 |
(listener/hub) restarts. A restarted authenticator loses all session state |
| 342 |
and re-challenges previously-authenticated callers with EAP-Request/Identity, |
| 343 |
but a caller parked in EAP SUCCESS refused that request and a freshly |
| 344 |
restarted authenticator ignored the caller's recovery START, so the peer sat |
| 345 |
in "Waiting for EAP authentication" and carried no data until an operator |
| 346 |
restarted the caller. A persistent identity request while authenticated now |
| 347 |
drives one bounded re-run of the SRP handshake, and the authenticator |
| 348 |
re-challenges on every START, so the session recovers without intervention. |
| 349 |
- Receiver: the "Too many old packets, resetting buffer" error no longer |
| 350 |
repeats on every output cycle on degraded or bonded links. The flow reset |
| 351 |
that emits it now clears its internal trigger, so a sustained run of late |
| 352 |
packets logs at most one message per reset instead of flooding the log. |
| 353 |
- recovery-depth: requesting the maximum depth no longer fails on 32-bit |
| 354 |
platforms. The effective maximum is capped to what the platform can |
| 355 |
address (still 16 on 64-bit), with a log message when a request is capped; |
| 356 |
this also fixes the recovery_depth unit test on 32-bit builds. |
| 357 |
- Advanced<->Main retransmissions are now resolved correctly. An |
| 358 |
Advanced-profile sender indexes its retransmit buffer by the 32-bit |
| 359 |
advanced sequence, but a peer that negotiated down to Main (TR-06-3: an |
| 360 |
Advanced device starts each peer in Main and only frames Advanced once |
| 361 |
the peer advertises I=1) requests retransmits with a 16-bit RTP sequence |
| 362 |
and nack_seq_msb = 0. Those two sequence spaces are independent, so the |
| 363 |
Main peer's NACK never matched the 32-bit index and nothing was |
| 364 |
retransmitted. The Advanced sender now keeps a parallel 16-bit RTP |
| 365 |
retransmit index and resolves, validates, and frames a downgraded-Main |
| 366 |
peer's retransmits in the RTP domain. Advanced<->Advanced behaviour is |
| 367 |
unchanged. |
| 368 |
- risttunnel: fix an intermittent SIGSEGV at startup caused by an |
| 369 |
uninitialised logging-settings pointer. risttunnel now points log_ptr |
| 370 |
at the static logging settings like the other tools, so rist_logging_set() |
| 371 |
configures them in place instead of writing through a garbage pointer. |
| 372 |
As a side effect the -v loglevel now also applies to risttunnel's own |
| 373 |
messages. |
| 374 |
- risttunnel now presents SRP credentials on its sender/client legs. |
| 375 |
Only the listener (-F verifier file) enabled EAP-SRP before, so a |
| 376 |
risttunnel pointed at an SRP-protected listener failed with |
| 377 |
"credentials have not been configured" while the listener waited |
| 378 |
forever for authentication. When the URL carries both an SRP |
| 379 |
username and password, risttunnel now calls rist_enable_eap_srp_2() |
| 380 |
on the peer like ristsender/ristreceiver/rist2rist; the receiver leg |
| 381 |
falls back to the verifier file when no credentials are supplied. |
| 382 |
- Fixed a use-after-free in rist_oob_dequeue. rist_oob_write() stashes |
| 383 |
the destination peer from a caller thread and the protocol thread |
| 384 |
sends it later; a peer torn down by a NAT rebind or session timeout |
| 385 |
in between (e.g. the child peer the risttunnel --single-port reverse |
| 386 |
path captures via the auth/connect callback) left the send path |
| 387 |
dereferencing a freed peer - an intermittent SIGSEGV. The dequeue |
| 388 |
now takes peerlist_lock, verifies the stashed peer is still on the |
| 389 |
live peer list, drops the packet if it is gone, and holds the lock |
| 390 |
across the whole send so a concurrent add/remove cannot free the |
| 391 |
peer underneath it. |
| 392 |
- rist_receiver_data_block_free2() is now a no-op on a NULL block, |
| 393 |
like free(NULL). The receiver data_fd/tun delivery path can |
| 394 |
legitimately hold a NULL block by the time the fifo-overflow branch |
| 395 |
frees it: free_data_block() nulls the pointer after a successful |
| 396 |
free, and merged FEC pairs never allocate one. The previous |
| 397 |
unconditional (*block)->ref dereference therefore read offset 0x40 |
| 398 |
of a NULL pointer and crashed (observed as "segfault at 40") on |
| 399 |
listeners running risttunnel under abrupt link changes. The guard |
| 400 |
protects every caller, not just the data_fd path. |
| 401 |
- Advanced receiver: fix a spurious "Rist data out fifo queue overflow" |
| 402 |
(issue #218) when an Advanced flow upgrades from Main to Advanced wire |
| 403 |
framing mid-stream. The two framings carry source_time in different |
| 404 |
timestamp domains, so the framing switch resets the flow timing |
| 405 |
baseline; that reset re-derived time_offset but left the clock-drift |
| 406 |
sample buffer populated with stale Main-domain samples. The next |
| 407 |
median recalculation then jumped the offset by several seconds and |
| 408 |
released the whole receiver buffer at once, overflowing the data-out |
| 409 |
fifo. The baseline reset now also clears the drift samples, matching |
| 410 |
the existing clock-wrap reset. This was most visible as reproducible |
| 411 |
failures of the advanced+unicast+client tests on slower build hosts. |
| 412 |
- Build: tools/ristsender.c no longer trips -Woverlength-strings |
| 413 |
(issue #219). Adding --blind-send to the usage text pushed the help |
| 414 |
string past the 4095-character C99 string-literal limit; it is now |
| 415 |
split into two literals printed back to back (output unchanged). |
| 416 |
- Build: fix compilation with SRP support disabled (issue #220). The |
| 417 |
listener cname re-association added an unguarded eap_is_authenticated() |
| 418 |
call whose declaration lives under HAVE_SRP_SUPPORT; the call is now |
| 419 |
guarded, and without SRP the re-association safely refuses (the cname |
| 420 |
is not a per-peer secret, so it must not migrate a peer unauthenticated). |
| 421 |
- Sender stats reported tiny "packets_sent"/"packets_received" deltas |
| 422 |
(issue #221) when the structured callback was registered with |
| 423 |
rist_stats_callback_set(). That setter updated the common stats interval |
| 424 |
but not the sender's own copy, which the sender loop actually reads, so it |
| 425 |
stayed 0 and the callback fired every loop iteration instead of once per |
| 426 |
interval; each report then covered only one pass. The setter now also |
| 427 |
sets the sender interval (matching rist_sender_stats_callback_set), and |
| 428 |
the sender loop reads the interval fresh each pass and skips reporting |
| 429 |
entirely when it is 0, so a stats-disabled sender no longer builds a |
| 430 |
stats object every iteration. Affected risttunnel's sender stats; the |
| 431 |
bundled Prometheus path (ristsender) uses the legacy setter and was not. |
| 432 |
- udpsocket: size the socket buffers toward the OS maximum instead of a |
| 433 |
fixed 1 MB. The helpers request up to 8 MB, which the kernel clamps to |
| 434 |
net.core.{r,w}mem_max, so a listener absorbs a burst of simultaneous |
| 435 |
connections without the kernel dropping the overflowing handshake |
| 436 |
datagrams (seen as Udp: RcvbufErrors) while the single protocol thread |
| 437 |
drains the socket. Hosts with a small rmem_max fall back to the prior |
| 438 |
1 MB / 200 KB behaviour and are unaffected. |
| 439 |
- EAP-SRP: a single-port/NAT'd caller whose listener restarts now recovers on |
| 440 |
its own. Previously SRP callers were excluded from the silent caller socket |
| 441 |
rebind, so once the listener lost all session state the caller sat idle |
| 442 |
until an operator restarted it. The caller now resets its EAP context and |
| 443 |
re-authenticates on a fresh socket; the supplicant also retransmits its |
| 444 |
EAPOL START while the far end is silent, so a restarted listener that missed |
| 445 |
the first START still challenges it. The rebind backoff resets once a peer |
| 446 |
re-authenticates, so a later outage retries promptly instead of after an |
| 447 |
ever-growing gap. Covered by the srp mode of |
| 448 |
test/rist/test_caller_socket_rebind. |
| 449 |
|
| 450 |
CI / Test Coverage: |
| 451 |
- The reflector test no longer fails intermittently on slow or heavily |
| 452 |
loaded build machines. It asserted RTT and jitter-buffer convergence |
| 453 |
behind fixed settling and timeout deadlines that a loaded builder could |
| 454 |
miss, causing spurious FTBFS that cleared on retry. It now polls for the |
| 455 |
actual convergence conditions with generous caps and a longer test |
| 456 |
timeout; the assertions are unchanged. |
| 457 |
|
| 458 |
|
| 459 |
Changes for 0.2.18: |
| 460 |
--------------------------------- |
| 461 |
|
| 462 |
ABI/API: |
| 463 |
- ABI version 15:0:11 (soversion 4, binary-compatible with 0.2.15, |
| 464 |
0.2.16, and 0.2.17) |
| 465 |
- API version 4.12.0 (new features, backwards-compatible) |
| 466 |
- RIST_PEER_CONFIG_VERSION bumped from 2 to 3 (one new field: |
| 467 |
srp_compat_legacy). Existing zero-initialised peer configs |
| 468 |
continue to work; the new field defaults to 0 (spec-compliant). |
| 469 |
- RIST_PEER_CONFIG_VERSION bumped from 3 to 4 (two new fields: |
| 470 |
profile + profile_set, populated by the ?profile= URL parameter). |
| 471 |
rist_peer_config_defaults_set() initialises both to safe defaults |
| 472 |
(profile = RIST_DEFAULT_PROFILE, profile_set = 0). Existing |
| 473 |
zero-initialised configs keep their pre-bump behaviour. |
| 474 |
- New rist_peer_config_defaults_set_versioned(cfg, version) initialises |
| 475 |
only the fields defined at or below the given RIST_PEER_CONFIG_VERSION. |
| 476 |
rist_peer_config_defaults_set() is now a static inline wrapper (peer.h) |
| 477 |
that forwards the caller's compiled RIST_PEER_CONFIG_VERSION, so a |
| 478 |
recompiled caller initialises exactly the fields its struct contains. |
| 479 |
The exported rist_peer_config_defaults_set() symbol is retained for |
| 480 |
binaries linked against an earlier library; it assumes version 0 and |
| 481 |
sets only the baseline fields present in every struct revision. Such |
| 482 |
binaries must zero-initialise their config before the call: fields |
| 483 |
added in version 1+ (split_mode, merge_mode, profile, profile_set) |
| 484 |
are left untouched. |
| 485 |
- RIST_PEER_CONFIG_VERSION bumped from 4 to 5 (two new fields: |
| 486 |
recovery_priority, populated by the ?recovery-priority= URL |
| 487 |
parameter, and recovery_depth, populated by ?recovery-depth=). |
| 488 |
rist_peer_config_defaults_set_versioned() initialises them for |
| 489 |
callers compiled against version 5 or later (recovery_priority = 0, |
| 490 |
recovery_depth = RIST_RECOVERY_DEPTH_DEFAULT); zero-initialised |
| 491 |
configs and callers built against an earlier version keep the legacy |
| 492 |
NACK-routing behaviour and the default recovery ring. |
| 493 |
- New public API rist_recovery_depth_set(ctx, depth) and the |
| 494 |
RIST_RECOVERY_DEPTH_MIN/DEFAULT/MAX macros (peer.h) size the |
| 495 |
Advanced-profile retransmission ring. depth is a base-2 exponent: |
| 496 |
the ring holds 65536 << depth packets (default 3 = 8x = the prior |
| 497 |
fixed size, range 0..16). Must be called before rist_start(). |
| 498 |
- New public macro RIST_PEER_WEIGHT_DUPLICATE (0) names the |
| 499 |
rist_peer_config.weight sentinel that selects packet duplication |
| 500 |
instead of weighted load-balancing. Value unchanged. |
| 501 |
- RIST_STATS_VERSION bumped from 2 to 3 and the JSON stats |
| 502 |
schema_version from 3 to 4 (additive): rist_stats_sender_peer gains |
| 503 |
profile + advanced_active, rist_stats_receiver_flow gains profile + |
| 504 |
seq_bits + advanced_active. Consumers reading only earlier fields are |
| 505 |
unaffected. |
| 506 |
|
| 507 |
Features: |
| 508 |
- Per-peer retransmission routing: the new ?recovery-priority=<n> |
| 509 |
peer URL parameter (rist_peer_config.recovery_priority) lets a |
| 510 |
receiver direct NACKs to a chosen peer when a flow is carried by |
| 511 |
more than one RTCP-capable peer. Each NACK group is sent to the |
| 512 |
eligible peer with the highest recovery_priority, ties broken by |
| 513 |
lowest RTT. The default of 0 on every peer preserves the prior |
| 514 |
lowest-RTT selection. Useful when the lowest-RTT peer cannot |
| 515 |
answer NACKs (e.g. a duplicate/relay feed with no retransmit |
| 516 |
buffer) while a higher-RTT peer holds the retransmission buffer. |
| 517 |
- Tunable Advanced-profile recovery depth: the recovery rings are now |
| 518 |
heap-allocated and profile-sized, so Simple/Main flows allocate only |
| 519 |
their 16-bit ring (65536 packets) instead of the Advanced footprint. |
| 520 |
The Advanced ring size is selectable via ?recovery-depth=N (or |
| 521 |
rist_recovery_depth_set()), where N is a base-2 exponent and the ring |
| 522 |
holds 65536 << N packets. The default of 3 (524288 packets) matches |
| 523 |
the previous fixed size; higher values trade RAM for a deeper NACK |
| 524 |
window. Simple/Main ignore the knob. A config-time warning is |
| 525 |
emitted when a peer's bitrate and buffer settings would exceed the |
| 526 |
recovery ring's addressable window. |
| 527 |
- Advanced/Main profile interoperability (TR-06-3 Section 9): an |
| 528 |
Advanced sender starts in Main framing and upgrades a peer to |
| 529 |
Advanced framing only after that peer advertises Advanced capability, |
| 530 |
so a Main-only receiver can still decode the stream. An Advanced |
| 531 |
receiver accepts a Main-framed source and follows a mid-stream |
| 532 |
Main->Advanced upgrade. Matched Advanced and matched Main pairs are |
| 533 |
unchanged. |
| 534 |
- The default RIST profile is now Advanced (RIST_DEFAULT_PROFILE, and |
| 535 |
the ristsender/ristreceiver/YAML defaults that follow it), changed |
| 536 |
from Main. Thanks to the interop above, a default Advanced endpoint |
| 537 |
negotiates Advanced framing with an Advanced peer and falls back to |
| 538 |
Main framing with a Main-only peer, so existing Main deployments keep |
| 539 |
working. Pass -p 1 (or profile: 1 in YAML) to force Main as before. |
| 540 |
- risttunnel now defaults to RIST_DEFAULT_PROFILE like the other tools, |
| 541 |
instead of remaining hardcoded to Main, completing the default-profile |
| 542 |
sweep. |
| 543 |
- Advanced-profile visibility in statistics: the binary stats API and the |
| 544 |
JSON stats now report each flow's configured profile and, on the |
| 545 |
receiver, whether Advanced framing is actually active and the sequence |
| 546 |
width in use. The Prometheus exporter adds rist_client_flow_info / |
| 547 |
rist_sender_peer_info series carrying these labels, so a dashboard can |
| 548 |
tell at a glance when it is monitoring an Advanced stream. |
| 549 |
|
| 550 |
Bug Fixes: |
| 551 |
- Advanced profile: a sequence gap larger than 65535 is no longer |
| 552 |
truncated to 16 bits, so a real >64k loss on a 32-bit flow is recovered |
| 553 |
instead of being mis-detected as a tiny gap. |
| 554 |
- Advanced profile: receiver_mark_missing() now masks the sequence into the |
| 555 |
retransmission ring index. A 32-bit sequence eventually exceeds the ring |
| 556 |
size; the old raw index ran off the array and could crash the receiver on |
| 557 |
a long-running Advanced flow. |
| 558 |
- The expected-next-sequence wrap mask no longer forces the value even (it |
| 559 |
masked with UINT16_MAX-1), which mis-computed every odd successor on |
| 560 |
16-bit flows. |
| 561 |
- Advanced byte accounting now counts delivered payload only, matching the |
| 562 |
Simple/Main convention, so received-byte and bitrate stats are consistent |
| 563 |
across profiles. |
| 564 |
- Duplicate detection compares the sequence number rather than the source |
| 565 |
timestamp, fixing false duplicate decisions on Advanced arrival-stamped |
| 566 |
packets. |
| 567 |
- Merge-mode pairing computes the successor sequence in a 32-bit-safe way, |
| 568 |
so paired packets are matched correctly on Advanced flows. |
| 569 |
- Advanced Profile (TR-06-3) RTT Echo Responses inflated the measured |
| 570 |
round-trip time by a constant factor. The sender will not retransmit |
| 571 |
a packet again within one RTT of the previous attempt, so the inflated |
| 572 |
value made it ignore the repeat NACKs needed when a retransmission is |
| 573 |
itself lost, leaving packets unrecovered under sustained loss. The |
| 574 |
Advanced echo now uses calculate_rtt_delay(), as the Simple and Main |
| 575 |
profiles do. |
| 576 |
- Fixed a receiver abort when a retransmitted or gap-filled packet's |
| 577 |
arrival time is interpolated. With peers whose clocks are not |
| 578 |
synchronised the estimate could fall outside its neighbouring queue |
| 579 |
slots, tripping an assert in debug builds or misordering the queue |
| 580 |
otherwise. Interpolation is now bounds-checked, rounded without |
| 581 |
overshoot, wrap/reorder-aware, and clamped to the neighbour interval. |
| 582 |
- NAT source-port rebind recovery (issue #188): when a calling |
| 583 |
receiver's external source port changes (NAT mapping rebind, DHCP |
| 584 |
renewal), the listening sender no longer treats it as a brand-new |
| 585 |
caller that leaves the old peer record orphaned until session |
| 586 |
timeout. Listener-side re-association requires an authenticated |
| 587 |
per-peer SRP session: once a new child completes SRP authentication |
| 588 |
and learns its cname from an RTCP SDES, its source tuple is migrated |
| 589 |
into the matching silent sibling. This path is SRP-only because the |
| 590 |
cname alone is not a per-peer secret under a shared PSK. Plaintext |
| 591 |
and shared-PSK callers recover on the caller side instead: a |
| 592 |
caller-mode receiver on a MAIN+ profile with no pinned local port |
| 593 |
rebinds its UDP socket to a fresh ephemeral port on session timeout |
| 594 |
and restarts the handshake instead of giving up. |
| 595 |
- ?profile=0|1|2 in a peer URL (0=Simple, 1=Main, 2=Advanced) now |
| 596 |
overrides the wire profile of the context that owns the peer. |
| 597 |
rist_parse_address2 parses the value into rist_peer_config; on the |
| 598 |
first matching peer added before rist_start(), rist_peer_create |
| 599 |
mutates the context profile and lazily initialises the Advanced |
| 600 |
profile state when upgrading to Advanced. Subsequent peers must |
| 601 |
request the same profile (or omit the parameter); rist_peer_create |
| 602 |
returns -1 with a WARN once the context profile is locked (after |
| 603 |
rist_start() or a prior peer fixed it). Any consumer that passes |
| 604 |
URLs through rist_parse_address2 + rist_peer_create now gets the |
| 605 |
URL-driven profile selection with no further integration work. |
| 606 |
- Fixed a use-after-free in the global logger when an application frees |
| 607 |
its rist_logging_settings, either directly via |
| 608 |
rist_logging_settings_free2() or by destroying a context that embeds |
| 609 |
them (as FFmpeg does), while the global logger still references that |
| 610 |
callback and argument. The global logging settings are now cleared |
| 611 |
when the matching settings are freed, so logs emitted afterwards (for |
| 612 |
example from background threads on a rapid close/reopen) no longer |
| 613 |
call into freed memory. |
| 614 |
- rist_peer_config_defaults_set() no longer writes past the end of a |
| 615 |
peer config supplied by a binary compiled against an older |
| 616 |
RIST_PEER_CONFIG_VERSION, and parse_url_options() / store_peer_settings() |
| 617 |
no longer touch version-specific fields unless peer_config->version is |
| 618 |
high enough: reflector, multicast_ttl, multicast_source and local_port |
| 619 |
require version >= 2; srp_compat_legacy requires version >= 3. |
| 620 |
- Windows XP support restored: rist_transport_poll() now uses |
| 621 |
select() via the existing contrib/poll_win.c shim instead of |
| 622 |
WSAPoll() (Vista+ only). Regression introduced in 0.2.17. |
| 623 |
- rist_peer_recv() now accepts both canonical numeric EAGAIN errno |
| 624 |
values (11 and 35) when a custom transport_ops backend signals |
| 625 |
"no data ready", protecting cross-compile environments where the |
| 626 |
EAGAIN macro can resolve differently across translation units. |
| 627 |
- librist/transport.h now defines ssize_t on Windows (#214), so |
| 628 |
downstream consumers no longer have to provide their own typedef. |
| 629 |
- Prometheus exporter: counter rows in multiple_metric_datapoints |
| 630 |
mode now have a space between the value and the timestamp. |
| 631 |
Affected every existing _total row. |
| 632 |
- Prometheus exporter: in single_stat_point mode, the displayed |
| 633 |
value no longer freezes at the first callback and silently |
| 634 |
drops every subsequent sample. Affected all receiver-flow, |
| 635 |
sender-peer, and per-peer-receiver gauges. |
| 636 |
- Receiver flow stats: bitrate, bitrate_retries, bitrate_rejected |
| 637 |
and bitrate_ts_nulls now decay to zero when the corresponding |
| 638 |
traffic stops, instead of remaining frozen at the last value |
| 639 |
computed while traffic was still flowing (#217). |
| 640 |
|
| 641 |
SRP interoperability: |
| 642 |
- 0.2.16 made TLS-SRP RFC 5054 / TR-06-2 compliant by adding the |
| 643 |
PAD operation to the u and k hash inputs. As a side effect, |
| 644 |
SRP-authenticated peers running 0.2.15 or earlier (which omitted |
| 645 |
the PAD) will not handshake with 0.2.16+. Upgrading both ends |
| 646 |
to 0.2.16+ remains the recommended fix. |
| 647 |
- New URL parameter for transitional interop: |
| 648 |
?srp-compat=1 |
| 649 |
On both ends of the SRP exchange, this opts the SRP wire format |
| 650 |
back into the pre-0.2.16 unpadded form. Must be set on BOTH |
| 651 |
sides; mixed configuration will still fail. An explicit WARN |
| 652 |
is logged on startup when the option is active. Intended only |
| 653 |
as an escape hatch while older deployments are upgraded. |
| 654 |
- When an SRP handshake fails, the authenticator (and the client |
| 655 |
on M2 mismatch) now emits a single INFO hint pointing at the |
| 656 |
srp-compat=1 escape hatch. The hint is advisory only - |
| 657 |
the SRP-6a transcript binds M1 to the authenticator's wire-mode |
| 658 |
B, so there is no purely-local way to distinguish "wrong |
| 659 |
password" from "peer is on the other wire format" once the |
| 660 |
handshake has reached M1. No action required for non-SRP |
| 661 |
deployments. |
| 662 |
|
| 663 |
CI / Test Coverage: |
| 664 |
- srp_unit_test now runs in test-ubuntu. cmocka is sourced via a |
| 665 |
new subprojects/cmocka.wrap (WrapDB 1.1.8-1) so the test builds |
| 666 |
even on runner images that do not ship libcmocka-dev, closing the |
| 667 |
silent-skip gap that hid the SRP fixture drift reported in #215. |
| 668 |
Test fixtures regenerated for the PAD-compliant SRP exchange |
| 669 |
against the 2048-bit RFC 5054 group. Added four end-to-end tests |
| 670 |
covering both PAD and legacy modes plus the two cross-mode failure |
| 671 |
cases. |
| 672 |
- The issue #188 NAT/socket-rebind and multipath cname integration |
| 673 |
tests now compile under MSVC: they use the Windows pthread-shim |
| 674 |
(runtime mutex initialisation and PTHREAD_START_FUNC thread entry |
| 675 |
points) instead of a direct <pthread.h> dependency. |
| 676 |
|
| 677 |
Tools: |
| 678 |
- ristsender: new --blind-send option. Decouples the sender from |
| 679 |
RIST peer state - multicast input groups are joined immediately |
| 680 |
and incoming UDP data is written to the RIST context regardless |
| 681 |
of whether any output peer has connected. Intended for |
| 682 |
fire-and-forget broadcast topologies (multicast output in |
| 683 |
simple/main/advanced profile, or ristsender used as a relay / |
| 684 |
fan-out in front of non-RIST consumers). |
| 685 |
- Prometheus exporter: new per-peer receiver metric block |
| 686 |
rist_receiver_peer_* with labels {peer_id, peer_url, flow_id, |
| 687 |
receiver_id}, mirroring rist_sender_peer_*. Auto-registered |
| 688 |
from rist_stats_receiver_flow.peers[]. |
| 689 |
- Prometheus exporter: new client-flow gauge |
| 690 |
rist_client_flow_avg_buffer_time_seconds reporting the dynamic |
| 691 |
receiver buffer fill level (sourced from avg_buffer_time in |
| 692 |
rist_stats_receiver_flow, converted from ms to seconds). |
| 693 |
- Prometheus exporter: now also exports receiver counters that were |
| 694 |
previously JSON-only: retries, dropped-late, dropped-full, duplicates, |
| 695 |
and the NACK-depth recovery buckets (recovered after two / three / four |
| 696 |
/ more NACKs). |
| 697 |
|
| 698 |
|
| 699 |
Changes for 0.2.17: |
| 700 |
--------------------------------- |
| 701 |
|
| 702 |
ABI/API: |
| 703 |
- ABI version 12:0:8 (soversion 4, binary-compatible with 0.2.15) |
| 704 |
- API version 4.9.0 (new features, backwards-compatible) |
| 705 |
- RIST_STATS_VERSION bumped from 1 to 2 (new byte-counter fields |
| 706 |
appended to rist_stats_sender_peer, rist_stats_receiver_peer, |
| 707 |
and rist_stats_receiver_flow). |
| 708 |
- RIST_STATS_JSON_SCHEMA_VERSION bumped from 2 to 3 (new fields: |
| 709 |
sent_bytes, retransmitted_bytes, received_bytes). |
| 710 |
- RIST_PEER_CONFIG_VERSION bumped from 1 to 2 (new fields: |
| 711 |
multicast_ttl, multicast_source, local_port). |
| 712 |
|
| 713 |
New Features: |
| 714 |
|
| 715 |
Pluggable Transport Abstraction (transport.h): |
| 716 |
- New rist_transport_ops vtable replaces direct socket syscalls with |
| 717 |
user-supplied callbacks (sendto, recvfrom, socket, bind, close, |
| 718 |
setsockopt, poll). Enables librist on non-POSIX platforms such as |
| 719 |
WebAssembly/WebTransport, userspace network stacks, or unit-test |
| 720 |
harnesses. |
| 721 |
- New rist_transport_set() installs custom transport ops on a context. |
| 722 |
- Default ops delegate to real syscalls so existing behaviour is |
| 723 |
unchanged. |
| 724 |
|
| 725 |
Packet Split / Merge (peer.h): |
| 726 |
- Sender: split each application write into an even/odd sequence pair |
| 727 |
when the payload exceeds half the path MTU. Controlled by |
| 728 |
split_mode in rist_peer_config (off, auto, half). |
| 729 |
- Receiver: transparently merge split pairs before delivery. |
| 730 |
Controlled by merge_mode in rist_peer_config (off, pairs, auto). |
| 731 |
- Keepalive advertises split capability via the L bit; receiver |
| 732 |
auto-detects when the sender supports it. |
| 733 |
- URL parameters: ?split=off|auto|half, ?merge=off|pairs|auto. |
| 734 |
- Split/merge counters surfaced in JSON statistics. |
| 735 |
- risttunnel auto-enables split+merge when MTU < 1400. |
| 736 |
|
| 737 |
Advanced Profile (VSF TR-06-3): |
| 738 |
- Wire format and protocol integration for the Advanced Profile as |
| 739 |
defined by VSF TR-06-3. |
| 740 |
- Native control plane: Keep-Alive with I bit (CI=0x8000), RTT Echo |
| 741 |
Request/Response (CI=0x0010/0x0011), NACK Bitmask (CI=0x0000), |
| 742 |
NACK Range (CI=0x0001), Unsupported Response (CI=0x8020). |
| 743 |
- Full 32-bit sequence number indexing (expanded seq_index array). |
| 744 |
- Type 8 GRE-over-AP encapsulation for Section 9 interoperability. |
| 745 |
- PSK encryption mode 1 (AES-CTR, Main Profile compatible) with |
| 746 |
per-packet Nonce/IV in the AP header. |
| 747 |
- Future Nonce Announcement (CI=0x8011) for zero-latency key rotation. |
| 748 |
- SRP (Secure Remote Password) passphrase exchange, reusing the EAP-SRP |
| 749 |
state machine from Main Profile over Type 8 encapsulated EAPOL. |
| 750 |
- Flow ID field (I flag): virt_dst_port and virt_src_port map to/from |
| 751 |
the AP Outer/Inner Flow ID hierarchy on the wire. |
| 752 |
- LZ4 payload compression (LPC=1): sender compresses before encryption, |
| 753 |
receiver decompresses after decryption. Controlled by the existing |
| 754 |
?compression=1 URL parameter; receiver auto-detects via the LPC field. |
| 755 |
Bundled LZ4 library in contrib/lz4/ with system-library fallback. |
| 756 |
- Flow Attribute messages (CI=0x8001): sender periodically transmits |
| 757 |
session/flow metadata as JSON. New receiver callback API |
| 758 |
(rist_receiver_flow_attr_callback_set) delivers parsed attributes |
| 759 |
to the application. |
| 760 |
- Baseline.Direct conformance for single-flow encrypted point-to-point |
| 761 |
RIST transport with ARQ. |
| 762 |
- 22 integration tests (basic, packet loss, encryption, mismatch, |
| 763 |
flow-id, lz4, lz4+encryption, flow-attr, SRP auth). |
| 764 |
- 187 unit tests (wire format, timestamp, seq_index, Type 8, PSK modes, |
| 765 |
Flow ID mapping, LZ4 roundtrip, flow-attr control roundtrip). |
| 766 |
|
| 767 |
Per-byte statistics (#174): |
| 768 |
- Sender stats now include sent_bytes and retransmitted_bytes counters |
| 769 |
in both the C struct (rist_stats_sender_peer) and JSON output. |
| 770 |
- Receiver flow stats now include received_bytes in the C struct |
| 771 |
(rist_stats_receiver_flow) and JSON output. |
| 772 |
- Per-peer receiver stats include received_bytes. |
| 773 |
|
| 774 |
Multicast enhancements (#112): |
| 775 |
- Configurable multicast TTL via ?ttl=N URL parameter (1-255). |
| 776 |
New udpsocket_set_mcast_ttl() public API. |
| 777 |
- IGMPv3 Source-Specific Multicast (SSM) support via ?source=IP |
| 778 |
URL parameter. Uses IP_ADD_SOURCE_MEMBERSHIP / MCAST_JOIN_SOURCE_GROUP. |
| 779 |
- IPv6 multicast join support (previously only IPv4 was implemented). |
| 780 |
- New udpsocket_open_bind_mcast() with TTL and SSM source parameters. |
| 781 |
- udpsocket_join_mcast_group() now public API, supports IPv6 and SSM. |
| 782 |
|
| 783 |
Configurable local port for caller peers (#158): |
| 784 |
- New ?local-port=N URL parameter to bind caller (non-listening) peers |
| 785 |
to a specific local UDP port instead of using an ephemeral port. |
| 786 |
- New local_port field in rist_peer_config. |
| 787 |
|
| 788 |
Deferred multicast join in ristsender (#85): |
| 789 |
- When ristsender's input URL is a multicast address, the IGMP join |
| 790 |
is now deferred until the first RIST peer handshake completes. |
| 791 |
Prevents receiving multicast traffic before the output path is ready. |
| 792 |
|
| 793 |
WebAssembly / Emscripten: |
| 794 |
- TUN device stubs for Emscripten targets. |
| 795 |
- Meson cross-file (wasm32-emscripten.txt) for WASM builds. |
| 796 |
- C99 strict-aliasing fix for merge memcpy. |
| 797 |
|
| 798 |
Build: |
| 799 |
- Bundled mbedTLS upgraded from 2.28.10 (EOL) to 3.6.6 LTS. |
| 800 |
The bundled tree now compiles as a separate static library with |
| 801 |
targeted warning suppression, isolating mbedTLS internals from |
| 802 |
librist's strict compiler flags. Source compatibility fixes |
| 803 |
applied for the 2.x -> 3.x API migration (removed _ret suffixes, |
| 804 |
updated header paths). System mbedTLS 3.6.x is also fully |
| 805 |
supported. |
| 806 |
- Removed unused #include <mbedtls/entropy_poll.h> which broke |
| 807 |
builds against system mbedTLS >= 3.6 where the header was removed. |
| 808 |
|
| 809 |
Test: |
| 810 |
- Loss simulation tests no longer abort on transient error log |
| 811 |
messages. Under heavy bilateral loss, error-level messages are |
| 812 |
expected and do not indicate bugs. |
| 813 |
- Minimum receive threshold for loss tests now scales with the |
| 814 |
configured loss percentage, giving headroom for ARQ recovery in |
| 815 |
CI environments with timing jitter. |
| 816 |
|
| 817 |
New features: |
| 818 |
- Add transparent one-to-many reflector mode (Main Profile only). |
| 819 |
A receiver listener configured with ?reflector=1 transparently |
| 820 |
forwards data packets from the publisher (sender) to all subscriber |
| 821 |
(receiver) peers, and routes NACKs/RTCP from subscribers back to |
| 822 |
the publisher. Enables a single-listener fan-out topology without |
| 823 |
requiring a full sender context on the reflector. |
| 824 |
Trade-offs vs rist2rist (per-subscriber ARQ relay): |
| 825 |
* No per-subscriber retry buffer — recovery relies on the |
| 826 |
publisher's buffer, which may have aged out the packet. |
| 827 |
* Retransmissions fan out to ALL subscribers, not just the one |
| 828 |
that NACKed — bandwidth scales with subscriber count. |
| 829 |
* Recovery RTT is roughly 2x a direct connection. |
| 830 |
* No per-subscriber congestion control or statistics. |
| 831 |
Best suited for low subscriber counts with clean last-mile links. |
| 832 |
For high fan-out or lossy last-mile, use rist2rist instead. |
| 833 |
(contributed by RossWang) |
| 834 |
|
| 835 |
RTCP/NACK: |
| 836 |
- Fix OOB read in NACK_FMT_SEQEXT handler: the RTCP feedback loop |
| 837 |
validated only 4 bytes per record, but the seqext struct reads |
| 838 |
seq_msb at offset 12. A crafted datagram with a short trailing |
| 839 |
record could read up to 12 bytes past the allocation. Add a |
| 840 |
per-handler minimum-length check matching the adjacent ECHO branches. |
| 841 |
- Fix OOB read and log-disclosure in rist_sender_recv_nack: the NACK |
| 842 |
range handler read the 4-byte name field at offset 8 with only an |
| 843 |
8-byte minimum guarantee, and logged it with %s (unbounded read to |
| 844 |
next NUL). Add a sizeof guard and use %.4s. |
| 845 |
|
| 846 |
Log: |
| 847 |
- Lower log level for harmless cross-role NACK/data packets from |
| 848 |
ERROR/WARN to DEBUG to reduce log noise in reflector topologies. |
| 849 |
|
| 850 |
EAP/SRP: |
| 851 |
- Fix EAPOL-Start body length field: the packet declared a 4-byte body |
| 852 |
(sizeof(eapol_hdr)) when the correct value is 0 (EAPOL-Start carries |
| 853 |
no body). This bug was dormant until the bounds-check tightening in |
| 854 |
0.2.15 started correctly rejecting oversized body declarations, |
| 855 |
which broke every SRP handshake. SRP authentication has been |
| 856 |
non-functional since 0.2.15. |
| 857 |
- Fix off-by-one in eap_srp_send_password bounds check: the limit did |
| 858 |
not account for the 1-byte flags field before the ciphertext, so a |
| 859 |
maximum-length password would write 1 byte past the stack buffer. |
| 860 |
Not network-reachable (all callers cap at 128 bytes), but worth |
| 861 |
hardening. |
| 862 |
|
| 863 |
|
| 864 |
Changes for 0.2.16 (pre-release): |
| 865 |
--------------------------------- |
| 866 |
|
| 867 |
ABI/API: |
| 868 |
- ABI version 10:4:6 (soversion 4, binary-compatible with 0.2.15) |
| 869 |
- API version 4.7.0 (unchanged) |
| 870 |
|
| 871 |
Maintenance and security-hardening release for 0.2.15. No source or |
| 872 |
binary changes are required of downstream consumers. |
| 873 |
|
| 874 |
Bug Fixes: |
| 875 |
|
| 876 |
Windows: |
| 877 |
- Windows tools fail to start when remote logging is enabled. |
| 878 |
Running `ristreceiver -r 127.0.0.1:port ...` on Windows 11 would |
| 879 |
exit immediately with "Failed to setup logging!" because winsock |
| 880 |
had not been initialised before the public logging API tried to |
| 881 |
open a UDP socket. Fixes #208 (reported by Roman Dissertori). |
| 882 |
- EAP-SRP authentication fails on Windows with multiple peers. |
| 883 |
A 0.2.15 regression: an outbound packet that drew an ICMP |
| 884 |
port-unreachable reply caused Windows to corrupt the next |
| 885 |
incoming UDP datagram on the same socket, which then broke the |
| 886 |
EAP handshake. Most visible with bonded ethernet+wifi peers, |
| 887 |
Linux ristsender -> Windows ristreceiver. Fixes #209 (reported |
| 888 |
and confirmed fixed by Roman Dissertori). |
| 889 |
- Windows socket failure log lines now include the actual WSA |
| 890 |
error code, so user bug reports from Windows are diagnosable. |
| 891 |
- Cryptographic random number generator now seeds reliably on |
| 892 |
Windows runtimes where the legacy CryptoAPI (CryptAcquireContext |
| 893 |
/ CryptGenRandom) is missing or unconfigured - notably wine and |
| 894 |
some sandboxed container builds. The seeding path now uses the |
| 895 |
modern BCryptGenRandom (CNG) API, supported on every shipping |
| 896 |
Windows version. Without this fix, the 0.2.15 CSPRNG hardening |
| 897 |
refused to start the SRP/AES code paths in those environments |
| 898 |
rather than silently downgrade. Fixes #210. |
| 899 |
- MSVC builds no longer crash due to stack corruption in atomic |
| 900 |
operations. The stdatomic compatibility shim hardcoded all |
| 901 |
operations to a single width, so a 64-bit compare-exchange on a |
| 902 |
32-bit atomic variable overwrote adjacent stack memory. |
| 903 |
|
| 904 |
Tools: |
| 905 |
- ristsender now preserves incoming RTP sequence numbers and |
| 906 |
timestamps when the --rtp-sequence and --rtp-timestamp options |
| 907 |
are used. Previously these options had no effect. |
| 908 |
|
| 909 |
Hardening / follow-ups to 0.2.15: |
| 910 |
|
| 911 |
- EAP-SRP authentication retry exhaustion did not drop the failed |
| 912 |
peer. A latent sign-comparison bug meant a peer that failed |
| 913 |
every authentication retry was kept around in a half- |
| 914 |
authenticated state instead of being dropped. Not externally |
| 915 |
reported. |
| 916 |
- Crypto random number generator could silently downgrade to a |
| 917 |
weak fallback. If the CSPRNG seed call failed at startup (no |
| 918 |
kernel entropy source - sandboxed container, embedded image |
| 919 |
without /dev/urandom, broken build), the failure was dropped |
| 920 |
and the wall-clock-derived stopgap was used for the lifetime of |
| 921 |
the process. Now logs loudly and refuses to hand out random |
| 922 |
bytes. Not externally reported. |
| 923 |
- Internal EAP error code documentation: clarify a guard comment |
| 924 |
that read as a removable paranoia check but is actually |
| 925 |
protecting against a NULL function pointer. |
| 926 |
|
| 927 |
Post-0.2.15 audit follow-ups (reported by Thomas Guillem): |
| 928 |
|
| 929 |
Receiver flow / peer accounting: |
| 930 |
- Receivers no longer crash or corrupt their peer list when a |
| 931 |
peer is added to a flow at the same instant another thread is |
| 932 |
removing one. The list of peers per flow was being walked by |
| 933 |
one thread under one lock and modified by another thread under |
| 934 |
a different lock; the two paths now agree. A 256-peer-per-flow |
| 935 |
cap is also enforced so a misconfigured (or hostile) sender |
| 936 |
cannot grow the list without bound. |
| 937 |
- Receivers stop creating flows once 256 active flows already |
| 938 |
exist. Previously the count was checked and the new flow |
| 939 |
allocated in separate steps, so a burst of new flow IDs could |
| 940 |
race past the limit. Now the count check and the slot insert |
| 941 |
happen under the same lock. |
| 942 |
|
| 943 |
EAP-SRP authenticator: |
| 944 |
- Authenticated peers can no longer be deauthenticated by a |
| 945 |
spoofed EAPOL-LOGOFF. A successfully authenticated session |
| 946 |
used to reset to start-over state on receipt of any LOGOFF |
| 947 |
packet, which made the auth state machine trivially DoSable |
| 948 |
from off-path. LOGOFF is now only honoured before the session |
| 949 |
reaches authenticated state, and a legitimate LOGOFF before |
| 950 |
that point also resets the retry counter so a counter |
| 951 |
wrap-around can't lock the peer out for the lifetime of the |
| 952 |
process. |
| 953 |
- A spoofed EAP FAILURE no longer pushes the local state machine |
| 954 |
into permanent failure. FAILURE packets are now matched |
| 955 |
against the identifier of the in-flight EAP exchange and |
| 956 |
dropped if they don't match, the same way Request/Response are |
| 957 |
matched. A genuine FAILURE still latches the peer out, but |
| 958 |
after a 30-second quiet period the peer is allowed to retry |
| 959 |
from the start so a transient burst of bad responses doesn't |
| 960 |
require restarting the process. |
| 961 |
- EAP authenticators no longer answer EAP Identity requests |
| 962 |
themselves. The handler used to run on both roles, so a |
| 963 |
misbehaving (or attacker-controlled) authenticatee could |
| 964 |
persuade the authenticator to discard its own session state |
| 965 |
and start over. The handler is now restricted to the |
| 966 |
authenticatee role, and even there it is rate-limited so the |
| 967 |
pre-auth reset cannot be triggered repeatedly to wipe |
| 968 |
in-progress sessions. |
| 969 |
- EAP SRP setup now caps the advertised modulus (N) and |
| 970 |
generator (g) lengths at 1024 bytes (8192-bit groups, the |
| 971 |
largest standard RFC 5054 group). A peer that advertised |
| 972 |
multi-megabyte values used to allocate that much memory and |
| 973 |
burn that much CPU on bignum imports before deciding the |
| 974 |
handshake was bogus. |
| 975 |
|
| 976 |
PSK encryption: |
| 977 |
- The PSK nonce generator no longer falls back to a |
| 978 |
wall-clock-derived value when the CSPRNG misbehaves. Nonces |
| 979 |
are required to come from the system CSPRNG; if it fails or |
| 980 |
returns suspect output the key is marked broken, encryption |
| 981 |
refuses to produce ciphertext for that key (sends zeroes |
| 982 |
instead so a downstream consumer cannot mistake it for a |
| 983 |
successful encrypt), and the existing audible logging fires. |
| 984 |
Decryption was already locked out in the same condition; this |
| 985 |
closes the encrypt-side gap. The non-security-critical |
| 986 |
`prand_u32` helper used elsewhere in the tree keeps its |
| 987 |
wall-clock fallback because its callers don't need |
| 988 |
unpredictability. |
| 989 |
- PSK decryption now skips the PBKDF2 key derivation when the |
| 990 |
key is already locked out. A bursty stream of malformed |
| 991 |
encrypted packets at a peer whose key state was already |
| 992 |
compromised used to spin tens of thousands of PBKDF2 rounds |
| 993 |
per packet before rejecting it. The lockout check now happens |
| 994 |
first, so the per-packet cost drops to a few comparisons. |
| 995 |
- PSK AES-CTR dispatch no longer silently falls back to AES-128 |
| 996 |
on an unknown key size. The earlier switch-case used a |
| 997 |
fallthrough that meant a corrupted or unsupported key length |
| 998 |
would still be processed (with the wrong cipher), which |
| 999 |
masked configuration errors. Unknown key sizes now return |
| 1000 |
without touching the buffer. |
| 1001 |
|
| 1002 |
SRP / cryptographic primitives: |
| 1003 |
- The Nettle build of SRP no longer feeds uninitialized stack |
| 1004 |
into the bignum library when the CSPRNG returns no entropy. |
| 1005 |
The Nettle random callback's signature returns void, so a |
| 1006 |
CSPRNG failure was previously dropped on the floor and the |
| 1007 |
caller computed against whatever was on the stack. The |
| 1008 |
callback now zeroes its output buffer and signals the caller |
| 1009 |
via a side-channel context; the bignum operation then fails |
| 1010 |
cleanly. The mbedTLS build was already correct. |
| 1011 |
- The SRP NG (N/g) group identifier enum now keeps its |
| 1012 |
pre-0.2.15 integer values. The 0.2.15 release deleted the two |
| 1013 |
smallest groups (NG_512, NG_768 - both below current |
| 1014 |
minimum-strength thresholds) but shifted every remaining |
| 1015 |
enum entry down by two as a side effect. The integer "2", |
| 1016 |
which any external caller might reasonably have hardcoded |
| 1017 |
for NG_1024, silently started meaning NG_4096. The deleted |
| 1018 |
values 0 and 1 are now explicit reserved slots that return |
| 1019 |
"no such group" - code that uses the named constants |
| 1020 |
(`LIBRIST_SRP_NG_1024` etc.) is unaffected, code that used |
| 1021 |
literal integers either gets the group it asked for or a |
| 1022 |
clean error. |
| 1023 |
|
| 1024 |
Statistics JSON: |
| 1025 |
- The stats JSON payloads (sender flow, sender per-peer wrapper, |
| 1026 |
receiver flow) now carry an explicit top-level |
| 1027 |
`schema_version` field. The current value is 2 - version 1 was |
| 1028 |
the duplicate-`peer`-key sender shape that v0.2.15 replaced |
| 1029 |
with a `peers` array (NEWS noted the change, but downstream |
| 1030 |
parsers had no way to detect which shape they were getting). |
| 1031 |
Any future incompatible shape change must bump this number. |
| 1032 |
- The sender `cname` field copy is now explicitly |
| 1033 |
NUL-terminated. The previous strncpy with a destination-sized |
| 1034 |
length depended on a separate bounds check elsewhere in the |
| 1035 |
receive path to keep the result safe; the contract is now |
| 1036 |
self-contained. |
| 1037 |
|
| 1038 |
Build / portability: |
| 1039 |
- librist now requires mbedTLS >= 2.7 (March 2018), and emits a |
| 1040 |
clean #error if built against anything older. The compatibility |
| 1041 |
branch for pre-2.7 mbedTLS releases (which used the |
| 1042 |
void-returning SHA-256 API) had no CI coverage and was the |
| 1043 |
same untestable corner that produced a 0.2.14 build break - |
| 1044 |
dropping it removes the surface area entirely. Every still- |
| 1045 |
supported distro is well past 2.7; the bundled tree is 2.28.x. |
| 1046 |
- On Windows, the mbedTLS CSPRNG seed no longer reaches into |
| 1047 |
private mbedtls_entropy_context fields to keep its source |
| 1048 |
count happy. It now seeds the CTR_DRBG directly from |
| 1049 |
BCryptGenRandom, skipping the entropy module entirely on |
| 1050 |
Windows. Non-Windows builds still use the normal entropy |
| 1051 |
initialisation path. |
| 1052 |
|
| 1053 |
Second audit follow-ups (reported by Thomas Guillem): |
| 1054 |
|
| 1055 |
EAP-SRP authentication: |
| 1056 |
- EAP passphrase response handler now gates on a matching |
| 1057 |
outstanding request identifier when a solicited passphrase |
| 1058 |
exchange is active. Previously any post-auth spoofed |
| 1059 |
RESPONSE/PASSWORD_REQUEST_RESPONSE was accepted, allowing a |
| 1060 |
man-on-the-side to hijack a key-rotation exchange. Unsolicited |
| 1061 |
passphrase pushes (rist_eap_send_passphrase) remain allowed as |
| 1062 |
the payload is encrypted under the SRP session key. |
| 1063 |
- EAP last_identifier is no longer primed in the request prologue |
| 1064 |
before subtype validation. A spoofed REQUEST with a crafted |
| 1065 |
identifier could prime the FAILURE-identifier gate, allowing a |
| 1066 |
subsequent spoofed FAILURE to latch the peer out. |
| 1067 |
- EAP authenticator initial identifier now comes from the CSPRNG |
| 1068 |
instead of prand_u32, closing an off-path prediction window. |
| 1069 |
- The use_default_2048 flag in EAP SRP challenge processing was |
| 1070 |
hardcoded true, ignoring wire-supplied N/g groups. Now derived |
| 1071 |
from the actual generator length on the wire. |
| 1072 |
- eap_set_ip_string replaced an unbounded memcpy with strncpy and |
| 1073 |
explicit NUL-termination. |
| 1074 |
|
| 1075 |
EAP-SRP / cryptographic primitives: |
| 1076 |
- SRP u and k hash computations now use RFC 5054 PAD: both inputs |
| 1077 |
are zero-extended to the byte length of N before hashing. The |
| 1078 |
previous unpadded hash produced different values for leading- |
| 1079 |
zero-byte operands, deviating from the specification. This is a |
| 1080 |
wire-incompatible change with pre-0.2.16 peers using SRP. |
| 1081 |
- SRP M1/M2 verification and client M2 verification now use a |
| 1082 |
constant-time comparison instead of memcmp. |
| 1083 |
- SRP authenticator aborts if the verifier v is zero (session key |
| 1084 |
would not depend on the password). |
| 1085 |
- SRP authenticator aborts if B mod N == 0 (RFC 5054). |
| 1086 |
- SRP authenticator aborts if u == 0 mod N after hashing A||B. |
| 1087 |
- SRP hash return values are now checked; unchecked failures |
| 1088 |
previously left uninitialised buffers in the session transcript. |
| 1089 |
- SRP BIGNUM_EXP_MOD return after computing S is now checked. |
| 1090 |
- SRP client context creation now validates modulus length |
| 1091 |
[128, 1024], generator length [1, N_len], and salt length |
| 1092 |
[1, 64] to cap resource consumption from malformed handshakes. |
| 1093 |
- SRP private exponent size now matches the modulus size instead |
| 1094 |
of a hardcoded 32 bytes, providing full-strength keying for |
| 1095 |
large groups (e.g. NG_8192). |
| 1096 |
- SRP salt generation now uses fixed-size 32-byte raw CSPRNG |
| 1097 |
output copied directly, instead of going through bignum export |
| 1098 |
which strips leading zero bytes and shrinks the effective salt |
| 1099 |
domain. |
| 1100 |
|
| 1101 |
Receive path / flow safety: |
| 1102 |
- Use-after-free on flow deletion during rist_receiver_data_read2 |
| 1103 |
is fixed. The flow pointer returned by the lookup function is |
| 1104 |
now validated under flows_lock; the flow's own mutex is acquired |
| 1105 |
before flows_lock is released. rist_delete_flow unlinks the |
| 1106 |
flow under the same lock before freeing. |
| 1107 |
- rist_receiver_set_output_fifo_size now rejects size == 0 and |
| 1108 |
size > 65536, preventing a zero-modulus OOB on the FIFO ring. |
| 1109 |
- rist_peer_get_cname uses strnlen instead of strlen, bounded by |
| 1110 |
RIST_MAX_STRING_SHORT. |
| 1111 |
|
| 1112 |
MPEG-TS null packet handling: |
| 1113 |
- expand_null_packets now bounds-checks each source-packet copy |
| 1114 |
against the original payload length, preventing an information |
| 1115 |
leak of adjacent buffer data when the NPD bit pattern implies |
| 1116 |
more real packets than the payload actually contains. |
| 1117 |
- suppress_null_packets now checks the sync byte of every packet |
| 1118 |
in the block, not just the first. |
| 1119 |
|
| 1120 |
SDES / cname / miface: |
| 1121 |
- RTCP SDES writer uses strnlen instead of strlen and zero-fills |
| 1122 |
the padding region explicitly, instead of copying adjacent |
| 1123 |
memory from the source buffer. |
| 1124 |
- All strncpy sites for peer cname and miface (peer_initialize, |
| 1125 |
rist_peer_clone) now have explicit NUL-termination. |
| 1126 |
|
| 1127 |
PSK encryption: |
| 1128 |
- PSK key init now uses strnlen and explicit NUL-termination |
| 1129 |
instead of unbounded strlen + memcpy. |
| 1130 |
- PSK key clone now explicitly NUL-terminates the copied password. |
| 1131 |
- PSK decrypt no longer unconditionally clears bad_decryption |
| 1132 |
after rekeying; if _librist_crypto_aes_key set the flag (PBKDF2 |
| 1133 |
failure), it stays set so the lockout counter is not reset. |
| 1134 |
|
| 1135 |
Sender: |
| 1136 |
- sender_buffer_size growth is now capped at sender_queue_max - 1, |
| 1137 |
preventing unbounded memory growth when packets are too young to |
| 1138 |
delete from the retry queue. |
| 1139 |
- rist_sender_peer_create now calls rist_peer_remove instead of |
| 1140 |
bare free on RTCP-peer creation failure, preventing a dangling |
| 1141 |
pointer in the peer list. |
| 1142 |
|
| 1143 |
Miscellaneous: |
| 1144 |
- rist_peer_remove dead store fixed: *next = NULL now executes |
| 1145 |
before the early return on NULL peer. |
| 1146 |
- NACK debug log guarded against zero-length array dereference |
| 1147 |
and uses %zu for size_t. |
| 1148 |
- is_ip_address uses a union of in_addr/in6_addr for the |
| 1149 |
inet_pton destination buffer, fixing an AF_INET6 stack overflow |
| 1150 |
that wrote 16 bytes into a 4-byte sockaddr_in.sin_addr. |
| 1151 |
- rist_new_connection log format strings replaced char[] locals |
| 1152 |
passed via &array with const char * pointers, eliminating |
| 1153 |
strict-aliasing undefined behaviour in the varargs call. |
| 1154 |
- rist_tun_write overflow guard changed from |
| 1155 |
len + UTUN_HEADER_SIZE > sizeof(tmp) to |
| 1156 |
len > sizeof(tmp) - UTUN_HEADER_SIZE, preventing unsigned |
| 1157 |
wraparound when len is near SIZE_MAX. |
| 1158 |
|
| 1159 |
Community bug reports (gitlab #211, RossWang): |
| 1160 |
|
| 1161 |
Receiver flow timing: |
| 1162 |
- Initialize last_packet_ts, time_offset_changed_ts, and |
| 1163 |
time_offset_old when a flow (re)starts. After a flow reset the |
| 1164 |
stale values from the previous epoch could cause the old-clock |
| 1165 |
fallback to fire, corrupting packet timing and dropping the |
| 1166 |
first few packets. |
| 1167 |
|
| 1168 |
OOB dequeue: |
| 1169 |
- rist_oob_dequeue now holds peerlist_lock while walking a |
| 1170 |
listener peer's child list. A concurrent peer add/remove could |
| 1171 |
free a sibling_next pointer during the walk. |
| 1172 |
|
| 1173 |
Note: _librist_peer_match_peer_addr (#211 item 3) also walks the |
| 1174 |
child list without a lock, but cannot use peerlist_lock because the |
| 1175 |
receive callback runs on the same thread that holds it in the |
| 1176 |
protocol loop. Fixing this requires a per-listener child rwlock or |
| 1177 |
reference counting, planned for a future release. |
| 1178 |
|
| 1179 |
Test / CI: |
| 1180 |
- New unit test (logging_init_order) that exercises the |
| 1181 |
rist_logging_set remote-address path before any rist_*_create |
| 1182 |
call. Would have caught #208 on the first Windows-CI run. |
| 1183 |
- The full meson test suite now runs against the cross-compiled |
| 1184 |
Windows binaries under wine, not just on Linux. Every protocol |
| 1185 |
test that gates Linux releases also gates Windows releases, |
| 1186 |
including the SRP / AES encryption suites which are now built |
| 1187 |
with mbedTLS on Windows (see the #210 fix above). The wine |
| 1188 |
runtime was already provisioned in the CI image; only the test |
| 1189 |
invocation was missing. Catches Windows-runtime regressions |
| 1190 |
without requiring a native Windows runner. |
| 1191 |
- Per-test results from the Linux job now show up directly in the |
| 1192 |
GitLab MR UI via meson's JUnit output, so reviewers don't have |
| 1193 |
to read job logs to see which test failed. |
| 1194 |
|
| 1195 |
|
| 1196 |
Changes for 0.2.15 (2026-05-14): |
| 1197 |
-------------------------------- |
| 1198 |
|
| 1199 |
ABI/API: |
| 1200 |
- ABI version 10:3:6 (soversion 4, binary-compatible with 0.2.14) |
| 1201 |
- API version 4.7.0 (unchanged) |
| 1202 |
|
| 1203 |
Security release. Existing 0.2.14 installations remain |
| 1204 |
binary-compatible; downstream consumers do not need to recompile. |
| 1205 |
|
| 1206 |
Security Fixes: |
| 1207 |
|
| 1208 |
Receive-side parsers and key handling were audited end to end. Each |
| 1209 |
fix below is independent. |
| 1210 |
|
| 1211 |
Receive path / RTCP: |
| 1212 |
- rist-common: bounds-check the RTP and RTP-extension headers. |
| 1213 |
The earlier check only covered the 4-byte reduced port subheader; |
| 1214 |
a truncated packet underflowed payload.size to ~SIZE_MAX which |
| 1215 |
then drove a malloc(len + 32) on the receiver enqueue path. |
| 1216 |
- rist-common: harden the RTCP dispatcher. Off-by-one in |
| 1217 |
bytes_left, integer overflow in 4*(1+records) (CPU spin on a |
| 1218 |
single packet), and an SDES handler that let 255 bytes be |
| 1219 |
memcpy'd into a 128-byte struct member, overrunning the adjacent |
| 1220 |
peer config/key state. |
| 1221 |
- rist-common: bound the XR block parser, clamp the on-the-wire |
| 1222 |
length to what we received, and guard the DLRR delay subtraction |
| 1223 |
so it can no longer pin last_rtt near UINT64_MAX (which would |
| 1224 |
permanently disable NACK timing on the peer). |
| 1225 |
- rist-common: validate the sender NACK record count before |
| 1226 |
iterating. ntohs(rtcp->len) - 2 underflowed to ~65K on a |
| 1227 |
malformed feedback packet, enqueueing OOB bytes as retransmit |
| 1228 |
requests and leaking them back to the peer. |
| 1229 |
- rist-common: add the missing return after the VSF length check, |
| 1230 |
and derive odd_nonce from the actual nonce byte rather than |
| 1231 |
GRE flags1 (the latter silently disabled the OTF passphrase |
| 1232 |
rotation feature on the receive side). |
| 1233 |
- rtcp: guard the RR and echo-response RTT subtractions and |
| 1234 |
size-check the SR / echo-request / echo-response casts (same |
| 1235 |
RTT-underflow primitive as above on the RR/echo paths). |
| 1236 |
- rtcp: correct the XR echoreq RTCP length field per RFC 3550; |
| 1237 |
receivers were reading 4 bytes past the actual XR block. |
| 1238 |
- mpegts: bound NPD expansion to the 7-packet wire encoding. |
| 1239 |
expand_null_packets used attacker-controlled payload_len and |
| 1240 |
npd_bits to drive ts_count and write up to 11 KB into a 10 KB |
| 1241 |
recv_npd buffer (overrunning into the adjacent RTCP TX buffer), |
| 1242 |
and shifted by a negative amount when ts_count > 7. |
| 1243 |
- gre: zero-init keepalive info on short packet and check return, |
| 1244 |
otherwise a truncated keepalive disclosed stack memory through |
| 1245 |
the user logging callback. |
| 1246 |
- udpsocket: NUL-terminate the URL hostname after strncpy so |
| 1247 |
udpsocket_resolve_host cannot over-read. |
| 1248 |
|
| 1249 |
PSK / AES-CTR: |
| 1250 |
- crypto: reject zero-nonce PSK packets instead of skipping |
| 1251 |
decryption. The previous early-return left the recv buffer |
| 1252 |
untouched and the caller treated the attacker's plaintext as a |
| 1253 |
freshly-decrypted Main Profile packet, bypassing the configured |
| 1254 |
PSK per packet. Pre-auth, single packet. |
| 1255 |
- crypto: correct nettle AES-CTR dispatch for 128/192-bit keys. |
| 1256 |
AES-128 was using nettle_aes192_encrypt against an aes128 |
| 1257 |
context; the AES-192 case was missing entirely, leaving an |
| 1258 |
uninitialised function pointer hot on the EAP password-rotation |
| 1259 |
path. |
| 1260 |
|
| 1261 |
EAP / SRP: |
| 1262 |
- eap: validate EAPOL/EAP/SRP-TLV lengths end to end. The body |
| 1263 |
length check was inverted and inner dispatchers walked past the |
| 1264 |
recv buffer with attacker-supplied lengths, exfiltrating heap |
| 1265 |
bytes through username copies and AES-CTR rewrites. Adjacent |
| 1266 |
fixes cover EAP header / dispatch / passphrase-flags reads. |
| 1267 |
- eap: NULL-check auth_ctx and propagate handle_A failure (notably |
| 1268 |
A == 0 mod N) so a rejected SRP exchange actually fails auth |
| 1269 |
instead of sending an uninitialised B back to the client. NULL |
| 1270 |
check the SRP client ctx and propagate the int-typed return of |
| 1271 |
the A/B writers (a -1 wrapped to ~SIZE_MAX and crashed on the |
| 1272 |
last_pkt malloc cache path). |
| 1273 |
- eap: bound rist_eap_send_passphrase to the destination buffer; |
| 1274 |
an over-long passphrase from the API or YAML config overran |
| 1275 |
ctx->unsollicited_passphrase into adjacent heap fields used by |
| 1276 |
the periodic retransmit. |
| 1277 |
- eap: rate-limit the EAP_CODE_FAILURE restart loop. The handler |
| 1278 |
unconditionally called eap_reset_data + log + EAPOL_START with |
| 1279 |
no retry counting, so a spoofed FAILURE per round-trip kept us |
| 1280 |
bouncing through reset+restart forever. |
| 1281 |
- eap: write the empty server-name placeholder into outpkt rather |
| 1282 |
than pkt (pure copy/paste typo that corrupted the recv buffer |
| 1283 |
on every successful identity response). |
| 1284 |
- srp: propagate failure when the client A, server B, or u is |
| 1285 |
congruent to 0 mod N. The checks existed but the failure path |
| 1286 |
left ret==0 so the caller continued the exchange. Auth bypass |
| 1287 |
primitive on both sides. |
| 1288 |
|
| 1289 |
PRNG: |
| 1290 |
- crypto: route prand_u32 through the CSPRNG. The previous |
| 1291 |
implementation called rand() seeded with a wall-clock NTP |
| 1292 |
timestamp; the result is used for the PSK GRE nonce (input to |
| 1293 |
PBKDF2), the EAP identifier and the peer SSRC. Reuse the mbedTLS |
| 1294 |
CTR-DRBG / GnuTLS RNG that already backs SRP key generation. |
| 1295 |
- crypto: fix operator-precedence bug in random_get_string and |
| 1296 |
add an upper bound on the local rand buffer. Affected callers |
| 1297 |
that ask for a runtime-derived password. |
| 1298 |
|
| 1299 |
Hygiene (not security-impacting on their own but shipped in the same |
| 1300 |
release): |
| 1301 |
- flow: handle realloc/calloc failure on the peer-list growth path |
| 1302 |
and rist_receiver_missing; correct two log format strings |
| 1303 |
(uint32_t printed with PRIu64; pointer where a PRIu32 was due). |
| 1304 |
- libevsocket: preserve the global context list when removing the |
| 1305 |
head; ctx_del previously cleared CTX_LIST instead of advancing |
| 1306 |
it to c->next. |
| 1307 |
- eap, logging, udpsocket: NULL-check the malloc/calloc results |
| 1308 |
that were dereferenced unconditionally; free the calloc'd ctx |
| 1309 |
on pthread_mutex_init failure in eap_clone_ctx; close the bound |
| 1310 |
socket on the multicast-join failure leg. |
| 1311 |
- network: on the GNU/Hurd MAC-address path, check socket() and |
| 1312 |
close it on the getifaddrs() failure leg. |
| 1313 |
|
| 1314 |
Additional fixes from the VideoLAN security audit: |
| 1315 |
|
| 1316 |
Independent receive-side / EAP / SRP audit shared by VideoLAN. |
| 1317 |
The findings already covered above are not re-listed; the items |
| 1318 |
below close the residual gaps. |
| 1319 |
|
| 1320 |
EAP / SRP: |
| 1321 |
- eap: ignore EAP_REQUEST_IDENTITY once we're past |
| 1322 |
EAP_AUTH_STATE_SUCCESS so a single forged identity request can |
| 1323 |
no longer tear an established session down and re-emit the |
| 1324 |
configured username on the wire. |
| 1325 |
- eap: refuse RESPONSE/IDENTITY on the authenticatee side |
| 1326 |
(lookup_func is NULL there per the calloc setup path; the |
| 1327 |
handler used to deref it unconditionally). |
| 1328 |
- eap: free verifier_data on every exit from |
| 1329 |
process_eap_response_identity. Three error paths returned -1 |
| 1330 |
before reaching the cleanup block, leaking the four heap |
| 1331 |
allocations the verifier lookup callback handed back. |
| 1332 |
- srp: jump to failed: instead of returning out of |
| 1333 |
BIGNUM_WRITE_BYTES when MPI write fails inside calc_x; the |
| 1334 |
return -1 path leaked hash_data. |
| 1335 |
- srp: check librist_crypto_srp_hash_bignum return in |
| 1336 |
calculate_m. The helper returns -1 (and leaves the output |
| 1337 |
buffer untouched) when the bignum exceeds its 1024-byte |
| 1338 |
staging buffer; the unchecked path XOR'd uninitialised stack |
| 1339 |
into the SRP transcript. |
| 1340 |
- srp: BIGNUM_INIT k and B in the authenticator constructor. |
| 1341 |
Relying on calloc-zeroed mbedtls_mpi state happened to work |
| 1342 |
today but the public mbedTLS contract requires explicit init. |
| 1343 |
- srp: bound A and B operand sizes against N before exp_mod. |
| 1344 |
handle_A and client_handle_B accepted any length from the |
| 1345 |
wire; mbedtls_mpi_exp_mod runtime grows with operand size. |
| 1346 |
- srp: NULL the caller's *bytes_s/*bytes_v in _create_verifier |
| 1347 |
failure paths so eap_reset_data does not double-free them. |
| 1348 |
- srp: capture mbedtls_mpi_fill_random return when generating |
| 1349 |
the salt; the previous `if (ret != 0)` re-checked the prior |
| 1350 |
BIGNUM_FROM_STRING. |
| 1351 |
- srp: repair the !USE_SHA_RET branch of librist_crypto_srp_hash |
| 1352 |
(referenced symbols from a different function and was missing |
| 1353 |
its trailing semicolon). |
| 1354 |
- srp: drop the sub-1024-bit RFC 5054 groups (NG_512, NG_768). |
| 1355 |
The enum was internal; the unit-test fixture that wanted the |
| 1356 |
deterministic 512-bit exchange now inlines the constants. |
| 1357 |
|
| 1358 |
PSK / AES-CTR: |
| 1359 |
- psk: fail closed when PBKDF2 setup fails on the mbedTLS path. |
| 1360 |
mbedtls_md_setup / mbedtls_pkcs5_pbkdf2_hmac errors used to |
| 1361 |
fall through into mbedtls_aes_setkey_enc with the |
| 1362 |
stack-allocated aes_key buffer in undefined state. |
| 1363 |
- psk: don't let an attacker-chosen nonce reset the bad-packet |
| 1364 |
lockout. _librist_crypto_psk_decrypt now keeps bad_decryption |
| 1365 |
set across nonce rolls so the five-bad-packets cap is no |
| 1366 |
longer trivially bypassed by sending a different nonce on |
| 1367 |
every shot. |
| 1368 |
- psk: use memcpy for the GRE nonce load instead of a punned |
| 1369 |
uint32_t cast (strict-aliasing UB; faulted on architectures |
| 1370 |
that require aligned uint32_t loads). |
| 1371 |
|
| 1372 |
Receive path: |
| 1373 |
- rist-common: lift the rist_rtp_hdr size check above the |
| 1374 |
Simple/REDUCED conditional so Main-profile FULL/EAPOL paths |
| 1375 |
can no longer read past recv_bufsize. |
| 1376 |
- udp: size the NPD scratch buffer for the real worst case |
| 1377 |
(7 * 204 + sizeof(rist_rtp_hdr_ext)). The previous 6 * 204 + 4 |
| 1378 |
was four bytes short for the (count == 7, suppressed == 1) |
| 1379 |
output and let suppress_null_packets smash four bytes of |
| 1380 |
stack past tmp_buf. |
| 1381 |
- rist-common: cast keepalive json_len to int for %.*s. size_t |
| 1382 |
via varargs is undefined per the C standard. |
| 1383 |
|
| 1384 |
Flow / threading: |
| 1385 |
- flow: take f->mutex when growing peer_lst; the realloc could |
| 1386 |
move storage and concurrent walkers (rist_best_rtt_index, the |
| 1387 |
output thread, stats) read peer_lst without synchronization. |
| 1388 |
- flow: cap receiver flows at RIST_MAX_FLOWS (256) and walk |
| 1389 |
FLOWS under flows_lock. Without a cap an attacker that can |
| 1390 |
land traffic on a receiver can exhaust memory by walking the |
| 1391 |
32-bit flow_id space. |
| 1392 |
- flow: NULL-check the dataout_fifo_queue calloc; the |
| 1393 |
data-output thread used to write into it unconditionally. |
| 1394 |
|
| 1395 |
TUN / RTCP TX / utility: |
| 1396 |
- tun_linux, tun_darwin: bounds-check prefix_len before computing |
| 1397 |
the netmask. prefix_len < 0 hit undefined behaviour in C and |
| 1398 |
prefix_len == 32 produced a 32-bit shift on a uint32_t (also |
| 1399 |
UB). |
| 1400 |
- tun_darwin: parse the utun unit suffix with strtoul, not atoi, |
| 1401 |
with full validation; falls back to "let the kernel pick" on |
| 1402 |
parse failure. |
| 1403 |
- rtp: clamp SDES name_len to 255 before computing sdes_size so |
| 1404 |
the on-the-wire length byte and the actual bytes copied stay |
| 1405 |
in agreement. |
| 1406 |
- rist-common: make compare() return a real three-way result |
| 1407 |
(qsort's contract is < 0 / 0 / > 0; the previous boolean cast |
| 1408 |
was undefined per POSIX). |
| 1409 |
- rist-common: pick the actual median in recalculate_clock_offset |
| 1410 |
(the index was biased high by one). |
| 1411 |
|
| 1412 |
Bug Fixes: |
| 1413 |
- rist-common: initialize peer->sd to -1 in peer_initialize so a |
| 1414 |
DNS resolution failure no longer leaves a zero socket |
| 1415 |
descriptor wired up to the event loop, which on Windows turned |
| 1416 |
into an infinite POLLERR loop and on Unix could attach the RIST |
| 1417 |
state to fd 0 (stdin). (!312, Yannick Le Roux) |
| 1418 |
- logging: check log_socket >= 0 instead of just non-zero in the |
| 1419 |
rist_log_impl UDP path, matching the LOGGING_SETTINGS_INITIALIZER |
| 1420 |
sentinel (the early-exit was tightened in f7ace4d but the send |
| 1421 |
branch still treated 0 as a valid fd). (!313, Daisuke Matsunami) |
| 1422 |
- stats: emit sender peers under a "peers" array. The previous |
| 1423 |
shape used "peer" as the key for every peer object, producing |
| 1424 |
invalid JSON and silently dropping all but one peer in strict |
| 1425 |
parsers. (#206, Manuel Alejandro) |
| 1426 |
|
| 1427 |
Tools: |
| 1428 |
- prometheus-exporter: implement rist_prometheus_parse_sender_stats. |
| 1429 |
The hook for ristsender's JSON stats callback was a TODO stub, so |
| 1430 |
sender-side rist_sender_peer_* gauges/counters never showed up at |
| 1431 |
the scrape endpoint. The parser now walks the new "peers" array |
| 1432 |
and feeds rist_prometheus_handle_sender_peer_stats; metric names |
| 1433 |
and shape are unchanged from the receiver-callback path. |
| 1434 |
(closes the second half of #206) |
| 1435 |
- ristsender: drop a duplicate rist_sender_stats_callback_set call |
| 1436 |
in setup_rist_peer that overwrote the per-instance arg with NULL, |
| 1437 |
breaking sender attribution when more than one sender ran in the |
| 1438 |
same process. |
| 1439 |
- udp2udp: log a one-shot warning when --metrics is enabled noting |
| 1440 |
that the relay produces no rist_* series (it uses librist only |
| 1441 |
for URL parsing and the httpd shell). |
| 1442 |
|
| 1443 |
Windows / MinGW Build: |
| 1444 |
- rist.c: return integer (not NULL) from the PTHREAD_START_FUNC |
| 1445 |
bodies. The macro expands to a DWORD __stdcall function on |
| 1446 |
Windows without HAVE_PTHREADS, which gcc14 rejected. |
| 1447 |
- meson: always probe clock_gettime via has_header_symbol on |
| 1448 |
Windows, not only when have_mingw_pthreads=true. Modern |
| 1449 |
mingw-w64 ships clock_gettime as a static inline in <time.h> |
| 1450 |
regardless of winpthreads, so contrib/time-shim.c collided |
| 1451 |
with the toolchain definition on the default build. |
| 1452 |
- rist-common: drain WSAECONNRESET with a real recvfrom buffer |
| 1453 |
on the rist_peer_sockerr POLLERR path. The previous NULL-buffer |
| 1454 |
call returned WSAEFAULT and left the indication in the socket |
| 1455 |
queue, causing WSAPoll to fire POLLERR in a tight loop and |
| 1456 |
flood the log with "Socket error!" whenever a peer went away. |
| 1457 |
(#205, Manuel Alejandro) |
| 1458 |
- tools: centralize the strtok_r/strtok_s shim in a header so |
| 1459 |
rist2rist (and any future tool that needs strtok_r) builds on |
| 1460 |
MinGW / MSVC. ristsender and ristreceiver had inline shims; |
| 1461 |
rist2rist's recent multi-peer bonding work added strtok_r |
| 1462 |
without one and failed to link. (#207, Thierry Lelegard) |
| 1463 |
|
| 1464 |
Changes for 0.2.14 (2026-04-25): |
| 1465 |
-------------------------------- |
| 1466 |
|
| 1467 |
ABI/API: |
| 1468 |
- ABI version 10:2:6 (soversion 4, binary-compatible with 0.2.13) |
| 1469 |
- API version 4.7.0 (unchanged) |
| 1470 |
|
| 1471 |
Maintenance release. No public API or ABI signature changes. |
| 1472 |
Existing 0.2.13 installations remain binary-compatible; downstream |
| 1473 |
consumers do not need to recompile and relink. |
| 1474 |
|
| 1475 |
Bug Fixes: |
| 1476 |
|
| 1477 |
- fix(sender): serialize retry-queue dequeue under peerlist_lock |
| 1478 |
to avoid a use-after-free. The retry-queue cleanup path could |
| 1479 |
race with peer teardown and dereference a peer that had already |
| 1480 |
been freed on a sibling thread, occasionally producing a sender |
| 1481 |
crash under sustained NACK pressure with multi-peer |
| 1482 |
configurations. The dequeue is now performed with the peerlist |
| 1483 |
lock held for the full critical section. |
| 1484 |
- fix(macos): honor the -1/errno contract in the time-shim and |
| 1485 |
zero-initialize the timespec before calling clock_gettime_osx. |
| 1486 |
rist__get_system_boottime() previously returned the errno value |
| 1487 |
as its result instead of -1, which silently produced corrupted |
| 1488 |
NTP timestamps on macOS in restricted-syscall environments |
| 1489 |
(containers, sandboxes that block sysctl(KERN_BOOTTIME)). The |
| 1490 |
function now returns sysctl()'s actual return value, and |
| 1491 |
timestampNTP_u64() / timestampNTP_RTC_u64() defensively |
| 1492 |
zero-init their timespec so a clock_gettime failure can no |
| 1493 |
longer leak uninitialized stack into the time arithmetic and |
| 1494 |
falsely trip the "stream is dead" timeout. |
| 1495 |
|
| 1496 |
Windows / MSVC / MinGW: |
| 1497 |
|
| 1498 |
- contrib/poll_win: fix the Windows poll() emulation busy-spinning |
| 1499 |
at 100% CPU when the watched fd set contains only sockets |
| 1500 |
(the common case for librist). The previous implementation fell |
| 1501 |
through to a 0 ms select() loop whenever no pipe/handle fds were |
| 1502 |
present; the timeout argument is now correctly honoured in the |
| 1503 |
sockets-only path. |
| 1504 |
- msvc: round out the contrib stdatomic shim and select native |
| 1505 |
C11 atomics where the toolchain supports them. Restores |
| 1506 |
correct atomic_uint_fast64_t behaviour on MSVC builds where |
| 1507 |
earlier shim coverage left some operations as plain reads / |
| 1508 |
writes, which (under heavy contention) could let the receiver |
| 1509 |
flow's last_pkt_received drift and produce false stream-dead |
| 1510 |
events on Windows. |
| 1511 |
|
| 1512 |
Tools: |
| 1513 |
|
| 1514 |
- tools/rist2rist: add multi-peer bonding (multiple input or |
| 1515 |
output URLs on the command line), MPEG-TS Null Packet Deletion |
| 1516 |
(NPD), and Prometheus metrics export. rist2rist can now serve |
| 1517 |
as a load-balancing relay sitting close to the source of truth, |
| 1518 |
where small recovery buffers and large retry queues let |
| 1519 |
downstream receivers absorb network impairments without |
| 1520 |
inflating end-to-end latency. |
| 1521 |
|
| 1522 |
Contrib (bundled mbedtls): |
| 1523 |
|
| 1524 |
- contrib/mbedtls: refresh bundled source from 2.26.0 to 2.28.10 |
| 1525 |
(last LTS release of the 2.x series, 2025-03-24). 2.28.x is |
| 1526 |
strictly ABI-compatible with 2.26.x, so no librist code change |
| 1527 |
was required. Notable mbedtls fixes pulled in: |
| 1528 |
* CVE-2025-27809 (TLS server impersonation via missing |
| 1529 |
mbedtls_ssl_set_hostname) |
| 1530 |
* CVE-2025-27810 (TLS 1.2 Finished message corruption on |
| 1531 |
allocator/HW failure) |
| 1532 |
* CVE-2024-45157 (PSA HMAC_DRBG selection regression) |
| 1533 |
* Multi-year accumulation of fixes in AES, ECP, MPI, RSA, |
| 1534 |
PK, PKCS5, bignum and the new constant_time.c |
| 1535 |
side-channel-hardened primitives. |
| 1536 |
librist itself only consumes the classic mbedtls crypto API |
| 1537 |
(AES-CTR, CTR-DRBG, entropy, SHA-256, PBKDF2, MPI), so the |
| 1538 |
upgrade is a drop-in replacement for the bundled path. The |
| 1539 |
system-mbedtls build path (-Dbuiltin_mbedtls=false, the |
| 1540 |
default when a system libmbedcrypto is detected) is not |
| 1541 |
touched by this commit. |
| 1542 |
- contrib/mbedtls: widen the hardclock gate from defined(_MSC_VER) |
| 1543 |
to defined(_WIN32) in the bundled timing.c, so MinGW and |
| 1544 |
Clang-Windows builds now also pick up the |
| 1545 |
QueryPerformanceCounter implementation of |
| 1546 |
mbedtls_timing_hardclock(). |
| 1547 |
|
| 1548 |
Contributors: |
| 1549 |
- Sergio Ammirata |
| 1550 |
|
| 1551 |
|
| 1552 |
Changes for 0.2.13 (2026-04-18): |
| 1553 |
-------------------------------- |
| 1554 |
|
| 1555 |
ABI/API: |
| 1556 |
- ABI version 10:1:6 (soversion 4, binary-compatible with 0.2.12) |
| 1557 |
- API version 4.7.0 (unchanged) |
| 1558 |
|
| 1559 |
Build Fixes: |
| 1560 |
|
| 1561 |
Platform build-fix release. No changes to the RIST protocol, public |
| 1562 |
API, or ABI signatures. All existing 0.2.12 installations remain |
| 1563 |
binary-compatible; downstream consumers do not need to recompile. |
| 1564 |
|
| 1565 |
This release is only relevant if you build librist targeting one of |
| 1566 |
the platforms listed below. Native Linux, native macOS, FreeBSD, |
| 1567 |
and classic Win32 builds with MSVC are unaffected. |
| 1568 |
|
| 1569 |
Windows desktop built with mingw-w64 (gcc or llvm-mingw): |
| 1570 |
- meson: detect clock_gettime with has_header_symbol |
| 1571 |
v0.2.12's probe used cc.has_function('clock_gettime'), which |
| 1572 |
does not resolve the static inline definition shipped by |
| 1573 |
mingw-w64's <pthread_time.h>. The resulting HAVE_CLOCK_GETTIME=0 |
| 1574 |
caused contrib/time-shim.h to emit a conflicting extern |
| 1575 |
declaration and broke any downstream build with strict warnings |
| 1576 |
("redefinition of 'clock_gettime'"). Switching to |
| 1577 |
cc.has_header_symbol detects the inline correctly. |
| 1578 |
|
| 1579 |
Windows UWP (i686/x86_64/aarch64-w64-mingw32 UWP toolchains): |
| 1580 |
- Also fixed by the has_header_symbol probe above. |
| 1581 |
- network.c: replace GetAdaptersInfo with GetAdaptersAddresses |
| 1582 |
_librist_network_get_macaddr() called GetAdaptersInfo, which is |
| 1583 |
not part of the UWP (WINAPI_FAMILY_APP) API surface; |
| 1584 |
llvm-mingw's UWP iphlpapi import library does not export it, |
| 1585 |
so UWP consumers of librist.a failed to link with "undefined |
| 1586 |
symbol: _GetAdaptersInfo". Replaced with GetAdaptersAddresses, |
| 1587 |
supported on classic Win32 desktop and on UWP since Windows 8. |
| 1588 |
|
| 1589 |
Embedded Apple SDKs (iOS, tvOS, watchOS, visionOS, all archs): |
| 1590 |
- tun_darwin.c: build as stubs on non-macOS Apple platforms |
| 1591 |
The v0.2.12 TUN support was guarded by #ifdef __APPLE__, but |
| 1592 |
<sys/kern_control.h> and <net/if_utun.h> only ship with the |
| 1593 |
macOS SDK. Every non-macOS Apple cross-build failed with |
| 1594 |
"fatal error: 'sys/kern_control.h' file not found", and simply |
| 1595 |
gating off the file produced a later link error because |
| 1596 |
src/rist.c and src/rist-common.c call rist_tun_read / |
| 1597 |
rist_tun_write unconditionally. Pull in <TargetConditionals.h>, |
| 1598 |
restrict the utun implementation to |
| 1599 |
defined(__APPLE__) && TARGET_OS_OSX, and add a second |
| 1600 |
#elif defined(__APPLE__) branch with stub implementations of |
| 1601 |
the seven public rist_tun_* entry points returning -1, matching |
| 1602 |
the pattern src/tun_win.c already uses on Windows. Real utun |
| 1603 |
support on macOS is unchanged. |
| 1604 |
|
| 1605 |
macOS used as a cross-build HOST: |
| 1606 |
- meson: skip Homebrew prefix lookup for cross-builds |
| 1607 |
The Homebrew fallback that adds /opt/homebrew or /usr/local |
| 1608 |
include paths was running unconditionally on any Darwin host. |
| 1609 |
Macs cross-compiling librist for iOS, tvOS, visionOS, Android, |
| 1610 |
or mingw could hang or fail at configure. Gated the lookup on |
| 1611 |
a native macOS build. Native-macOS-for-macOS builds are |
| 1612 |
unaffected. |
| 1613 |
|
| 1614 |
Contributors: |
| 1615 |
- Sergio Ammirata |
| 1616 |
|
| 1617 |
No source-file changes outside of meson.build, src/network.c, and |
| 1618 |
src/tun_darwin.c. |
| 1619 |
|
| 1620 |
|
| 1621 |
Changes for 0.2.12 (2026-04-17): |
| 1622 |
-------------------------------- |
| 1623 |
|
| 1624 |
ABI/API: |
| 1625 |
- ABI version 10:0:6 (soversion 4, binary-compatible with 0.2.11) |
| 1626 |
- API version 4.7.0 |
| 1627 |
|
| 1628 |
New Features: |
| 1629 |
- Cross-platform TUN support moved into the library |
| 1630 |
(rist_tun_open/close/read/write/set_ip/set_mtu/bring_up) |
| 1631 |
macOS (utun), Linux (/dev/net/tun), Windows (stub) |
| 1632 |
- data_fd forwarding API: rist_sender_data_fd_set, |
| 1633 |
rist_receiver_data_fd_set, rist_data_fd_stats_get |
| 1634 |
librist reads/writes directly to the fd, no application |
| 1635 |
code in the data path (works with sockets, FIFOs, TUN fds) |
| 1636 |
- New risttunnel tool: point-to-point IP tunnel over RIST |
| 1637 |
- YAML config file support for ristsender/ristreceiver with native parser |
| 1638 |
- Receiver session timeout API and --session-timeout CLI option |
| 1639 |
- Peer statistics in receiver output |
| 1640 |
- Multicast interface (miface) in sender peer statistics JSON |
| 1641 |
- avg_buffer_time field exposed in receiver_flow stats struct |
| 1642 |
- New udp2udp tool for UDP relay |
| 1643 |
- Profile selection (--profile) in rist2rist |
| 1644 |
- Sender input queue statistics |
| 1645 |
- MPEG-TS null packet suppression byte tracking |
| 1646 |
- Differentiated bitrate tracking and sender stats API |
| 1647 |
|
| 1648 |
Bug Fixes: |
| 1649 |
- Fix sender queue full detection: replace wrap-unsafe index |
| 1650 |
arithmetic (which silently misfired on ring-buffer wraparound) |
| 1651 |
with a size-vs-max comparison. Prevents in-flight retransmit |
| 1652 |
buffers from being silently overwritten under sustained load. |
| 1653 |
- Fix OOB main-profile data delivery: rist_send_seq_rtcp no |
| 1654 |
longer strips the first 4 bytes of zero-header OOB packets, |
| 1655 |
and rist_oob_dequeue now iterates child peers when the OOB |
| 1656 |
buffer references a listener peer (matching main-channel |
| 1657 |
behaviour instead of failing silently). |
| 1658 |
- Fix receiver crash on configurable RTT multiplier path |
| 1659 |
- Fix bogus lost-packet counters |
| 1660 |
- Fix premature stream stop on ECHO timeout for single-path (closes #196) |
| 1661 |
- Fix multi-sender queue issues (static buffer_size moved to context) |
| 1662 |
- Thread-safe FIFO access in rist_receiver_data_read2 |
| 1663 |
- Fix memory leaks (authentication failures, sender queue) |
| 1664 |
- Fix OpenMetrics response: add missing trailing EOF line |
| 1665 |
- Fix rist_client_flow_quality metric unit |
| 1666 |
- Fix OpenMetrics Content-Type header for Prometheus compatibility |
| 1667 |
- Fix RTT min/max invalid values |
| 1668 |
- Fix const correctness in URL parameter parsing |
| 1669 |
- Fix signed/unsigned comparison statements |
| 1670 |
- Fix missing strings.h include in yamlparse.c |
| 1671 |
- Fix clock used when processing RR with lsr older than last SR |
| 1672 |
- Fix -Wmisleading-indentation warning in receiver FIFO overflow path |
| 1673 |
- Fix tools build on macOS/Windows/FreeBSD: include endian-shim.h |
| 1674 |
for be16toh in ristsender.c and ristreceiver.c |
| 1675 |
- Fix tools build: always compile tunnel_interface/tun_mode into |
| 1676 |
rist_tools_config_object (consumers reference them unconditionally) |
| 1677 |
- Fix missing_counter bookkeeping: track queue length instead of |
| 1678 |
NACK-sent count. Previously the counter stayed at 0 on paths that |
| 1679 |
never emit NACKs (e.g. simple-profile multicast), causing the |
| 1680 |
missing_queue JSON stat to under-report and the congestion guard in |
| 1681 |
receiver_mark_missing to never trip. |
| 1682 |
- Fix build-only-platform-matching TUN source file; previously the |
| 1683 |
non-matching src/tun_*.c were compiled into an empty translation |
| 1684 |
unit and tripped -Werror=pedantic on Ubuntu/MinGW. |
| 1685 |
- Fix risttunnel build on MinGW: include <windows.h> for Sleep(). |
| 1686 |
|
| 1687 |
Improvements: |
| 1688 |
- Refactored sender queue management for better memory efficiency |
| 1689 |
- Improved UDP send reliability with EAGAIN retry |
| 1690 |
- Improved cname buffer safety |
| 1691 |
- Refactored flow timeout semantics |
| 1692 |
|
| 1693 |
Build System: |
| 1694 |
- TUN support is now always compiled; removed the use_tun meson option |
| 1695 |
- CI: drop -Duse_tun=true flag from ubuntu build job |
| 1696 |
- Fix false positive mbedtls detection in meson build |
| 1697 |
- Use MbedTLS cmake config module |
| 1698 |
- Check brew exists before calling (macOS) |
| 1699 |
- Fix compiler warnings in aes.h (Steve Lhomme) |
| 1700 |
|
| 1701 |
Acknowledgements: |
| 1702 |
- Dave Evans for RR clock fix |
| 1703 |
- Steve Lhomme for aes.h warning fixes |
| 1704 |
- Laur for the receiver FIFO misleading-indentation report |
| 1705 |
|
| 1706 |
|
| 1707 |
Changes for 0.2.11 (2024-11-15): |
| 1708 |
-------------------------------- |
| 1709 |
|
| 1710 |
New Features: |
| 1711 |
- Ephemeral listening ports support (add/remove ports after initialization) |
| 1712 |
- New function rist_sender_npd_get for null packet deletion status |
| 1713 |
- New function rist_peer_get_cname to extract peer's private cname |
| 1714 |
- Enhanced CI test application with packet integrity checks |
| 1715 |
|
| 1716 |
Bug Fixes: |
| 1717 |
- Fixed potential socket deadlock condition under MS Windows |
| 1718 |
- Fixed ristsender confusion with multicast addresses sharing destination port |
| 1719 |
- Fixed compile warnings under different C++ versions |
| 1720 |
- Fixed theoretical IP checksum calculation issue |
| 1721 |
- Fixed ristreceiver closing when tun://@ used in output URL |
| 1722 |
- Fixed deadlock condition on FIFO overflow |
| 1723 |
- Fixed invalid verbose-level parameter handling |
| 1724 |
- Fixed binding to raw UDP socket |
| 1725 |
- Fixed memory allocation order in stats structures |
| 1726 |
- Fixed Mac homebrew arm64 build |
| 1727 |
- Fixed null packet deletion |
| 1728 |
- Fixed units on sender Prometheus stats |
| 1729 |
- Fixed keepalive packet data corruption bug |
| 1730 |
- Fixed improper RTP/RTCP classification (affected ST2110) |
| 1731 |
- Fixed flow timeout to follow session timeout |
| 1732 |
- Updated peer config timing_mode field handling |
| 1733 |
|
| 1734 |
Build: |
| 1735 |
- Updated meson version to avoid deprecated items |
| 1736 |
|
| 1737 |
Acknowledgements: |
| 1738 |
- Special thanks to Thierry Lelegard for null packet deletion bug fix |
| 1739 |
|
| 1740 |
|
| 1741 |
Changes for 0.2.10 (2023-10-30): |
| 1742 |
-------------------------------- |
| 1743 |
|
| 1744 |
- Development branch merge with accumulated fixes and improvements |
| 1745 |
|
| 1746 |
|
| 1747 |
Changes for 0.2.9 (2023-10-11): |
| 1748 |
------------------------------- |
| 1749 |
|
| 1750 |
Bug Fixes: |
| 1751 |
- Fix compilation on 32-bit systems |
| 1752 |
- Fix regression in stats obj RTT value |
| 1753 |
- Remove unneeded locking in buffer scaling |
| 1754 |
- Fix "too old packages" error due to buffer scaling |
| 1755 |
- Fix empty buffer time check |
| 1756 |
- Disable buffer negotiation when sender max buffer < receiver buffer |
| 1757 |
- Fix deadlock caused by wrong lock order when removing peers |
| 1758 |
- Fix building Prometheus code against older libmicrohttpd |
| 1759 |
- Fix compilation on Hurd |
| 1760 |
|
| 1761 |
|
| 1762 |
Changes for 0.2.8 (2023-08-22): |
| 1763 |
------------------------------- |
| 1764 |
|
| 1765 |
New Features: |
| 1766 |
- SRP (Secure Remote Password) passphrase exchange |
| 1767 |
- Passphrase changing support via U1 bit on M1/M2 packets |
| 1768 |
- Fully implemented passphrase changing on multicast |
| 1769 |
|
| 1770 |
Bug Fixes: |
| 1771 |
- Add GRE check for bit 1 and GRE Ver set to 0 |
| 1772 |
- Fix SIGSEGV when peer_rtcp pointer is null |
| 1773 |
|
| 1774 |
Improvements: |
| 1775 |
- Refactored peer matching |
| 1776 |
- Refactored cryptographic randomness from SRP |
| 1777 |
- Added peer lock for thread safety |
| 1778 |
- Default PSK keysize to 256 if not set |
| 1779 |
|
| 1780 |
|
| 1781 |
Changes for 0.2.7 (2022-04-07): |
| 1782 |
------------------------------- |
| 1783 |
|
| 1784 |
New Features: |
| 1785 |
- Multiplexing support |
| 1786 |
- TUN (tunnel) interface support |
| 1787 |
|
| 1788 |
|
| 1789 |
Changes for 0.2.6 (2021-07-22): |
| 1790 |
------------------------------- |
| 1791 |
|
| 1792 |
Improvements: |
| 1793 |
- Move per-packet messages to debug level to prevent log flooding |
| 1794 |
- Release data earlier when real-time in buffer exceeds 1.1x buffer duration |
| 1795 |
- Drop stale packets older than 2x buffer duration |
| 1796 |
|
| 1797 |
|
| 1798 |
Changes for 0.2.5 (2021-07-20): |
| 1799 |
------------------------------- |
| 1800 |
|
| 1801 |
- Maintenance release with minor fixes |
| 1802 |
|
| 1803 |
|
| 1804 |
Changes for 0.2.4 (2021-06-25): |
| 1805 |
------------------------------- |
| 1806 |
|
| 1807 |
- Maintenance release with stability improvements |
| 1808 |
|
| 1809 |
|
| 1810 |
Changes for 0.2.3 (2021-06-22): |
| 1811 |
------------------------------- |
| 1812 |
|
| 1813 |
- Maintenance release with bug fixes |
| 1814 |
|
| 1815 |
|
| 1816 |
Changes for 0.2.2 (2021-06-16): |
| 1817 |
------------------------------- |
| 1818 |
|
| 1819 |
- Maintenance release |
| 1820 |
|
| 1821 |
|
| 1822 |
Changes for 0.2.1 (2021-06-10): |
| 1823 |
------------------------------- |
| 1824 |
|
| 1825 |
- Stability fixes for initial public release |
| 1826 |
|
| 1827 |
|
| 1828 |
Changes for 0.2.0 (2021-05-12): |
| 1829 |
------------------------------- |
| 1830 |
|
| 1831 |
Initial official public release of librist. |
| 1832 |
|
| 1833 |
Core Features: |
| 1834 |
- Full support for VSF TR-06-1 (Simple Profile) |
| 1835 |
- VSF TR-06-2 (Main Profile): |
| 1836 |
* PSK Encryption (AES 128 and 256) |
| 1837 |
* Bidirectional connection initiation |
| 1838 |
* Multipath support (load balanced or redundant link bonding) |
| 1839 |
* One-to-many distribution (media server mode) |
| 1840 |
* Tested packet recovery up to 50% continuous loss |
| 1841 |
* Jitter-tolerant output timing |
| 1842 |
|
| 1843 |
Tools: |
| 1844 |
- ristsender - RIST sender application |
| 1845 |
- ristreceiver - RIST receiver application |
| 1846 |
- rist2rist - RIST relay/proxy application |
| 1847 |
|
| 1848 |
Platform Support: |
| 1849 |
- Linux, macOS, Windows, FreeBSD |
| 1850 |
- Cross-compilation support via meson |
| 1851 |
|
| 1852 |
|
| 1853 |
Project Information: |
| 1854 |
-------------------- |
| 1855 |
|
| 1856 |
Website: https://code.videolan.org/rist/librist |
| 1857 |
License: BSD 2-Clause "Simplified" License |