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
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
Currently the helper accepts 0 length, but callers actually
can try to mutate it with `- 1` what means overflowing it.
e.g. `extmap_short_is_valid_data()` has a bitwise operation
including length `(id << 4) | (ext->len - 1)`
Change-Id: I74f7fa134355059b18ba8c2b4e671c735324bdb7
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
When binding the port to a socket, init fd to -1
because 0 is actually a valid id for fd in the system,
this `struct socket_port_link spl = {0};` puts `.fd = 0`
and if socket binding fails, then `.fd == 0` which is
a totally valid fd.
Instead init it to -1 and then let `add_socket()` to
actually fill the structure's data properly,
if however that one fails to bind, then again return
`.fd = -1`.
Change-Id: Iaeeee534a66b43441253ddfe710c8163084ad444
After marking the socket as being processed by this
thread, reset it back in case processing in
`stream_fd_readable()` returns due to exceeded queue.
Change-Id: Ia7415daf7eb568716ec88215b9f07ef551656c7c
Resolve file name conflicts between different components
Ensure shared log levels are identical across components
Encapsulates lib/*
Change-Id: If848d6fa0e4cd8eac88ce9e63ee77fc5a7a481fd
Introduce three new NG protocol flags that automatically select the matching
configured rtpengine interface based on the system's routing table:
- inbound-peer=<ip>: resolves to interface for inbound (from) direction
- outbound-peer=<ip>: resolves to interface for outbound (to) direction
- peer=<ip> resolves to interface when only one interface is required
When these flags are used, the system:
- Uses a temporary UDP socket to determine the local address assigned by routing
- Finds the first configured rtpengine interface matching that local address
- Uses that interface for the media stream
This allows dynamic interface selection based on network topology without
requiring explicit interface names in the signaling.
Closes#2033
Change-Id: I211806b9cef9d028fdb689d90ea3fe627bdf5d0d
Instead of opening local sockets directly during call setup, just create
the appropriate objects first, and then open the actual sockets in a
second step.
Move the opening step down, after the bundle logic has run. This way we
can avoid opening sockets that aren't needed.
Removes an intermediate step of obtaining consecutive ports.
Change-Id: Ib94c871ed6b3a433872afd23cb1aebbd9910b33e