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
(cherry picked from commit b688988363)
We are compressing the documentation explicitly with gzip, but were not
passing -n to get reproducible output.
Change-Id: I7819701ef33d34472eb2a63458ae16ef69ac352e
(cherry picked from commit 9b74a7fd12)
This is checked for race conditions but is not actually increased
anywhere.
Fixes#2148
Change-Id: Ia46ea32ffea6abf267f7ae872368f4f9c4446f29
(cherry picked from commit 5daae51b5b)
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
(cherry picked from commit 26fee2610a)
Per RFC 4867 section 8.1, absent fmtp parameters imply defaults (bandwidth-efficient mode, no CRC,
no robust-sorting, no interleaving). Previously, codec matching was rejected when either side had no
``a=fmtp`` attribute for the AMR payload type, causing AMR to be dropped as a "stray answer codec".
This patch changes this behavior to instead "parse" fmtp even when absent so that the format struct
is populated with zero-initialized defaults and fmtp_parsed is set.
Closes#2141
Change-Id: I1371cb1fdb9354746a4019477845d777e619a2f6
(cherry picked from commit 702ccec969)
(cherry picked from commit 84d62960a3)
Run the check against ICE candidates not just for DTLS packets, but for
all received packets, except STUN which have authentication and are
needed to learn new ICE candidates.
Change-Id: I25df8fa6db4f828a68ba3b9e5cd35d2b56c0df08
(cherry picked from commit 8317cc7071)
To not come across the sink's mutation (e.g. `endpoint.address.family`)
just lock way earlier, before to start processing and
translating endpoint to the kernel related structs.
Otherwise the other signaling path may mutate something
which will make the sink unactual and provide
to the `__re_address_translate_ep()` NULLed or garbage structs.
Change-Id: I88d87ae88abe4e37aaa5d3cdda76ed0ca82e4842
(cherry picked from commit e16a2309e0)
16de9688d6 resets the `socket.family` to NULL,
that makes the direct appeal to the corresponding
object unsafe.
E.g. `ps->selected_sfd->socket.family->name` when
filling the streams.
Add a simply guard and log `none` in case
the ip family is NULL.
Change-Id: I7ad7399e32e5d0ffb2fcc919822d05760fdc7421
(cherry picked from commit 05817bad13)
We use `family == NULL` as test for the socket being open in several
places, and expect it to match the familt of the addresses. Set it to
zero to make it consistent.
Change-Id: Ide2b41e84fc27b5f47f579dcf4ab2ec2f6b0a37e
(cherry picked from commit 16de9688d6)
ICE drops packets early in media_demux_protocols() (via
ice_peer_address_known()), which means in media_packet_address_check()
we can immediately set any socket as confirmed that has received
anything.
Take receiving socket into account to determine whether the endpoint is
a match.
Disable endpoint learning with ICE. ICE is in charge of determining
endpoint address and local socket.
`media-handover` and `strict-source` handling remains in place. With
`media-handover` set, we allow changing endpoint and local socket based
on what is actually received, overriding the nomination from ICE.
Change-Id: Ieac2893355df6ee560b497867181e6f47d646f2e
(cherry picked from commit d3af013494)
Don't just check for the selected_sfd to be non null, but also for the
socket to actually be open, as this is needed for the translate_ep set
of functions in particular.
Change-Id: I78cb0f7b8c9e4359c9e037485b29f63e0cd9476b
(cherry picked from commit 9cb902319c)
A stream that needs to be unkernelized that wasn't actually kernelized
due to lack of support or information still needs to have the flag reset
so that it can retried.
Change-Id: I7de17236d382d4f4dbfc3225c37688769cc9c8ad
(cherry picked from commit ab8b7fb228)
Pull the kernel in/out checks down below the "out" label, and use the
existing flags from the STUN connect event instead of directly calling
the relevant function.
Change-Id: Ide1ebf0d18446427535d9e63dadf7fdbbddc6c94
(cherry picked from commit 209e5a38dc)
Set the stream as kernelized even if it couldn't be, so that we don't
keep trying.
Change-Id: Icf05c6cab2f52d918ba04e7cb2089347b3f72378
(cherry picked from commit 46e8d6c305)
If SRTP/DTLS isn't yet established, do fully bail out of the kernelize
function, instead of just logging a message and blindly continuing, as
it would eventually fail due to missing or invalid SRTP parameters.
Fix-up for f2d57de078
Change-Id: I3521f54fe2001d3c67118a3502807d8cb6ada7ee
(cherry picked from commit 7ab5cf3ebf)
We can bail right there instead of having to rely on the
`(!reti->local.family)` condition
Change-Id: I584e90dd1a705cfbe1cd3e3d849e1fa88f511448
(cherry picked from commit dbcd657908)
Similar in spirit to f2d57de078, but for
the encrypt case.
Closes#2127
Change-Id: I06c82f4a1d768a863922e2240aebb6c1d243e269
(cherry picked from commit e6469c006b)
In case of the reverse direction of a subscription, no stream handler will be found. Previously, the
decrypt struct was left zeroed, the kernel module rejected this with ``EINVAL`` and the daemon logged:
```
[core] Failed to push relay stream to kernel: Invalid argument
```
This patch sets ``REC_NULL``/``REH_NULL`` and marks the target as non-forwarding, matching what is
expected by ``validate_srtp``.
Closes#2126
Change-Id: I5aa2b490c65e5d97dc9b2ddd24c09f9ae7b63892
(cherry picked from commit 47371520ee)
Allow invalid payload types for rejected RTP streams.
Allow empty codec store for zero-port streams.
Has some side effects on tests.
Closes#2122
Change-Id: I28c63a3e5b7309084e7899a19ff4550e8f56aac5
(cherry picked from commit 71cceeed5a)
ffmpeg's CNG expects a fixed frame size, or at least a maximum frame
size, as it allocates internal buffers on construction based on that
frame size. Calling the decoder with a larger frame size therefore leads
to an internal buffer overflow. Calling it with a smaller frame size is
fine.
Retain the simple one-shot CNG for the most common case (frame size
smaller than the max). For larger frames, call the CNG in a loop and
manually construct a return frame.
Change-Id: I0ebe0b7a9ad8a08bbabd0d8dea264b08cb44feee
(cherry picked from commit dfcb9a8322)
Currently the function has two cycles (while-outer-cycle and
for-inner-cycle).
The inner one operates on the given `pp` pointer and can potentially
mutate it (the pointer isn't const), hence the outer cycle will
continue with a mutated pointer.
Instead just use a local scope pointer to manipulate linked list's
data.
P.S.: the `pp` pointer isn't a double pointer, so unlikely was
expected (even by design) to be modified (e.g. its address or what
it actually points to).
Change-Id: Ia36bcb6fb47e9e72ae25a838f8005ca99f4c591d
(cherry picked from commit a4875c336e)
There seems to be a race condition with stream_fds/sockets being closed
while ICE checks are running at the same time, referencing the same
stream_fds. Solve this by holding a reference to the stream_fd in the
ICE pair object.
Additionally, add a check for a possibly closed socket when running
checks.
Closes#2113
Change-Id: I279a62d9e52cb1d409bcfda871766002aac4a758
(cherry picked from commit ceb7996cca)
For-cycle expects the `sink_ml` for setting the `call_media`
at the upper level of the cycle, but instead the `monologue`
is used, which is supposed to be used in the nested for-cycle.
Looks like a copy-paste typo. Major fix.
Change-Id: I225a51fde7fa8d10bac832ce5fc5444ee544e882
(cherry picked from commit 3285aec607)
Make sure data is 64-bit aligned. Fixes alignment issues on certain
32-bit archs (armhf).
Change-Id: I66c1fc20e97c62d3d5e266e874812aed74d295ed
(cherry picked from commit 31375ca349)
If someone wants to stop the media for this particular monologue,
and it already has the MP allocated, which is marked for MoH,
then just ignore the stop media command.
This is to not let the play media/stop media procedures
overlap with potentially (previously) triggered MP via MoH.
Change-Id: If0bf4264b9c640b99f844efe5c2c8bc201a6ad16
(cherry picked from commit c5fef5e0d4)
Both the play media and the music on hold use
the `media_player::call_play_media_for_ml()` as an entrance
towards the `media_player::media_player_new()` and
`media_player::media_player_play_init()`.
Prevent allocation of new MoH over ongoing one,
as well as the `play media` command over ongoing MoH.
Otherwise a media player will be re-used to override
ongoing activity.
Explicit policy must be used:
First the MoH has to be stopped
by getting back to the SDP `sendrecv` state, before
any other MoH request, or play media request can be fulfilled.
Change-Id: Ia5fdc10cfa8f491109ade9a2225b182ccdaa4778
(cherry picked from commit 7a83ce891a)
To show that player has been created.
Additionally: add one more log line
to track that the play media is being requested.
Change-Id: I4e8eb8f282654902a96bffb70c7c241e9c78b8d5
(cherry picked from commit 2dc3014149)
The `name` is caller-owned, while the cache itself
also keeps a separate key object
in the `media_player_media_files_names`.
This can desynchronize the hash key and the list key.
Hence prefer using the owned key instead.
Change-Id: I9b85c306cc4e2c32675bada3dec0d049ff5645fe
(cherry picked from commit 7a4feef1ff)
Already used by `--no-fallback`, so the rest just probably
inherited the same letter when doing copy-paste.
That is ambiguous and may cause option parsing conflicts.
Keep `F` only for the historical(most important) option
and set the rest to 0.
Change-Id: I6e4841f6e6614bfdfcf53d159130d6d676073d47
(cherry picked from commit b659b2371f)