The checkpoint moves from a list on the call to a pointer on the monologue,
and its snapshot covers only that monologue. Checkpoints are stored in the
call record as checkpoint-<monologue id>; num_checkpoints and the offerer
and answerer ids are gone.
A monologue is shared between the branches of a forked call, so rolling one
branch back no longer reinstates what rolling another back had undone.
The call-level json dict is no longer written into snapshots, since nothing
reads it back.
A snapshot now holds only the two monologues being checkpointed, and only
the entries the decoder reads: the socket and endpoint map pools, sinks,
subscriptions and aliases are left out.
The from-tag check in the rollback handler is dropped, since
call_get_monologue() is keyed on the tag.
Snapshots are now bencode, GLib macros are used throughout, and keys and
offsets are built with the existing helpers rather than by hand.
New tests cover the snapshot format and the state that exists only inside
a snapshot.
Add an opt-in rollback message to the NG protocol. It lets a signalling
application undo an SDP offer that rtpengine has applied but the remote
endpoint subsequently rejects, without deleting the established call.
A client enables checkpointing with track-state on an offer. rtpengine
snapshots the affected dialogue before applying it; an answer commits the
exchange and discards the snapshot, and rollback restores and consumes it.
A dialogue holds at most one outstanding checkpoint, so offers arriving
before an exchange completes keep the existing snapshot and a rollback
returns to the last completed offer/answer.
A checkpoint holds a snapshot in the call record format the Redis encoder
already produces, so there is one definition of what a call's state looks
like and no second encoder to keep in step. Decoding a snapshot needs the
field readers the Redis restore path already had, so those are shared
rather than duplicated; json_restore_call() reads the same fields, in the
same order, with the same strict-return behaviour.
Applying a snapshot copies negotiated state back onto the live objects,
matched by unique id. The objects are never recreated, so local sockets
and ports survive. State a rejected offer introduced is removed as well as
overwritten: a field the encoder writes only when set is absent from a
snapshot taken before it existed, and that absence clears it.
ICE and DTLS reconverge rather than being rewound, since applying the
offer has already reset the agent and shut down the DTLS association.
Restoring the accepted credentials and candidates lets connectivity checks
rebuild ICE state, and restoring the fingerprint, TLS id and setup permits
a fresh handshake.
Outstanding checkpoints are stored in the Redis call record so they
survive takeover. Checkpoint data is auxiliary: one that cannot be read is
discarded in full while the call itself is restored without rollback
capability.
The preload shims no longer inherit the sanitizer options from CFLAGS.
They are loaded by the harness into the test scripts' own interpreter,
where a sanitizer runtime crashed the daemon tests on aarch64 during
library initialisation. Everything else in CFLAGS, the Debian hardening
flags included, still applies to them.
The Redis tests no longer assume the record length is four digits, and
read the record across as many reads as it takes.
Convert skb to linear by making a copy if it isn't already, so that all
data can be easily accessed.
Change-Id: Iea4005ac0e650fea3c20eebe0da251d839dda7b5
The primary pair selection already checks this, but a retransmit can
still trigger a check on a socket that has since been closed.
Closes#2154
Change-Id: I8308693e7269bfa9dcfcb24daf6863669c065139
Previously, once rtpengine detected that the remote endpoint of a session is a local endpoint, the
loop check would be permanently enabled for that session. A renegotiation that changes the remote
endpoint to be non-local, did not cause the check to be turned off again. This patch addresses that.
Closes#2152
Change-Id: I880428b09f5d1e5b4641c9de4563010e31d7a790
6.12.101+ has removed this as well. Use the macro itself to determine
whether this struct member exists.
Change-Id: Ib43157567a78afc664398b9f22ee0a27b0facfa0
On some 32-bit architectures, such as armhf, the CPU does not have a
64-bit division instruction, and the compiler injects an intrinsic
function reference (such as __aeabi_ldivmod) that is provided for
example by libgcc.
When compiling Linux kernel code, we are not using libgcc, so such
references end up being undefined, failing the link. Instead we need to
use support provided by the kernel itself. In this case the do_div()
macro.
Change-Id: I5ed60aee487e66d6fcfc2293644d773b6820c178
If a SSRC object is still in use (refcount is >1), keep it in the list,
even if the list is too large.
Otherwise we may end up recreating a new SSRC object for the same SSRC
that still has an object in use elsewhere, making locks unreliable.
Ref #2148
Change-Id: I2afd277696e05c356fc9cf5aea59f51e1fba0784
Reuse the existing skb whenever possible for normal forwarding. Make a
copy only when needed: when decrypying or encrypting, or when there's
not enough space.
Change-Id: Ia3b020e65dcfcf0c4a63502607431144af44b1f4
Return the skb or NULL instead of true/false.
Take ownership of the passed skb and move the free into the inner
function on failure.
No functional change.
Change-Id: Ifb4f2f34f85f7c8b93accd781dc309f4dfa794b6
Combine error_nf_action with nf_action. Set the appropriate return value
based on the code path.
No functional change.
Change-Id: I548e1d6dbaeb38ce22c1dbcc3a8b697d995a77bc
We don't modify the skb for demux, so we can do the copy after we've
determined that it's needed. Requires more adjusting of the early-return
goto targets.
No functional change.
Change-Id: I8623e52170362b573921b1649cc6a95513b5c76a
We are compressing the documentation explicitly with gzip, but were not
passing -n to get reproducible output.
Change-Id: I7819701ef33d34472eb2a63458ae16ef69ac352e