From the cstdio docs, `snprintf()` - returns the number
of characters that would have been written
if n had been sufficiently large, not counting the terminating null character.
If a formatted unique id gets longer than 128 bytes,
or if the same happens later to the sequence of the formatted paramters,
then the according lenth becomes larger than the `sizeof(...)`,
and then the `append_meta_chunk()` may overflow the given buffer.
Just track the length by the fact after the printing is completed.
Also improve code formatting a little bit.
Change-Id: Ia3082623c4e59bd83c04af4c93851f8778bd73d2
Only do deletion if no other refs are open.
Add new "kill" method to override this.
Handle spurious EBUSY in daemon shutdown.
Change-Id: Ic84a0c3c1e3a007052baf19d22d79cbccf12c414
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
`vsnprintf()` returns the number of bytes that
would have been written, not the number actually stored in label.
If a formatted label gets longer than 127 bytes,
then the lablen becomes larger than the `sizeof(label)`,
and then `iov[0].iov_len = lablen;` makes the `writev()`
read past the stack buffer.
Similarly for the `infix`, but here the overflow should be less risky.
Also improve logging for the cases of unexpected
written size, or even a failure of the `writev()`.
Change-Id: I1a36ee262bec03c24b582219bc4d5babde685ed8
if rtp parsing failed and didn't set the `ssrc_in`,
then this would potentially be a NULL dereference later,
when handling bundle rtp.
Change-Id: I0e1f1041ffa3df6c44e313d756423fcdea37f579
When raising the log about the invalid port range,
be more concrete about the requirements for the range.
Also log the invalid excluded port.
Additionally: correct the code comment.
Change-Id: I3447003648e28c3ba2d3bfe8f7ed7c1f9425a44b
With big arrays of INTs, even though the variable type
isn't quite heavy, if the pool is for example around
10000...65535 (just because someone needs so many)
this loads the stack quite sensible. Just use heap for
these calculations.
Change-Id: I2ef838a1cb067e6986ba6a6b1c60945d437fabb0
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
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
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
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
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
With the more modern codec handling, there shouldn't be any more need to
unconditionally remove unsupported codecs if some codecs are requested
for transcoding.
Change-Id: Ica931de24ad6042f82e06d2efa69b93b4a7d8dd0