Older kernels (3.x) have ktime_t defined as a union, which means we
can't just treat it as a number and must wrap it inside {}. This still
also works for later kernels which have it typedef'd as an int.
closes#1708
Change-Id: I6195e45eb80f6e430e97247f62cd5f6696450b09
Don't explicitly set the "non forwarding" flag just because an RTCP
stream is being kernelised. The distinction between RTP and RTCP,
together with zero-length outputs setting "non forwarding" automatically
takes care of it.
Change-Id: Ie363fc369b7ace21ed172a0ec141c83afd1ba21b
When using recording via the proc interface, this error indicates that
the client (rtpengine-recording) is not reading the stream data fast
enough.
Closes#1676
Change-Id: I8a0d04745edb0e166f74d8ab5e8b979667f7f108
DTMF requires the "end" event to be sent multiple times, requiring
sequence number adjustments after DTMF injection has finished. Add
support for this to the kernel module.
Change-Id: Ie5c8f18eda39553a6ebbdd35ef2341be01f2a59f
This combines the REMG_DEL_TARGET method with REMG_GET_STATS. It
retrieves the stats of an existing target, returns them to userspace,
then proceeds to delete the target.
Change-Id: Ibd715c176f0415c49ac94b9e3c8d8cafdd829e1a
Check all the struct sizes as part of the startup NOOP command, to try
to catch incompatible kernel module versions.
Change-Id: Ib617878e1e5a813de199c5405db3680c1e4d3351
The unified `rtpengine_message` struct has become quite large, and most
fields are not used for most of the messages sent to the kernel module.
Use command-specific structures that only contain the required
information. Adapt the I/O code and the size checks to use the correct
sizes.
Do special handling for GET_*_STATS as these commands do both input and
output at the same time. Copy in only the input portion of the struct.
(Copy-out still copies the entire struct at this point.)
Change-Id: Ia8aec6135fd7de42ae4e62e7f2dc23804e1f0914
We don't necessarily have a parsed-out RTP header (e.g. when forwarding
T.38) so we can't use the RTP header values to keep stats. Use the
actual datagram size instead.
Change-Id: I16d25c3353dcd21a0e8c6e06610a8bfe6859710d
These are the entries the kernel will try to look for when userspace
tries to use the RTPENGINE support, but the module is called
xt_RTPENGINE so the kernel does not find it and thus cannot autoload
it.
The problem is that we have startup code that sets up iptables rules,
and will fail if the module has not yet been loaded. By adding these
aliases we are no longer concerned about the ordering, and can let the
kernel autoload the modules when they are needed.
Change-Id: I43a54af4e32adf755538c57df711da048c720030
… if it does not exist. Likewise in iptables-extension/Makefile .
daemon/rtpengine.pod: spell what MOS means
MAX_SESSIONS in config file does not work, it must be max-sessions.
https://github.com/sipwise/rtpengine/pull/1589
The kernel module must take the recording flag (`do_intercept`) into
account when `blackhole` is set, in order to make sure packets are not
dropped before they're passed to the recorder.
closes#1567
Change-Id: Ie2e0ad3d1941b5224fe823032e8349103c51e919
To make sure we always release the `skb` that is passed to us, be
explicit about when we have used it up (sent it out), so that we can
free it at function exit when we haven't.
Change-Id: I8ecff0ba54bbb64104b9125a2b8748667f08c42a
Only skip forwarding unknown payload types in the kernel module if
there's reason to skip them, i.e. when we know that certain payload
types must be handled in userspace. Use an explicit flag to signal this
to the kernel module instead of implicitly doing it for anything that is
RTP.
Change-Id: I655317afe64a27252bf7b8be6c78418db2e1ccef
This makes it possible to have different media silencing options for
different outputs. Functionally this commit alone is a no-op.
Change-Id: I967c3e07ea4645bb49ccb76db12d51ded2d72f06
Zero SSRC are technically invalid, but the code accepts them as valid
and therefore sets up things like crypto contexts for zero SSRCs.
Consequently it's possible to have a zero SSRC first in the list of
SSRCs and other valid SSRCs later in the list, which means we can't use
the presence of a non-zero SSRC first in the list as a flag to determine
whether SSRC tracking is in use or not. Use an explicit flag instead.
Change-Id: I88736e5d6b0f66c58f8d675137231760951e7610
Despite this code being called from userspace, we must disable
interrupts while having ssrc_stats_lock acquired, as the same lock is
acquired elsewhere from within an interrupt context.
closes#1492
Change-Id: Ia6f31eb876ee98ad355d12f9361cbc068d008608
All crypto suites except AEAD have an explicit packet authentication
stage. If authentication fails for a packet, we take some guesses about
a ROC mismatch and see if authentication can succeed with a different
ROC. If a working ROC is found, our tracked ROC is updated and
decryption proceeds.
AEAD doesn't have an explicit authentication stage and authentication is
performed implicitly by the decryption engine, which simply returns a
decryption error if the authentication fails. We must therefore add the
same ROC guessing logic at this step for AEAD.
Change-Id: Ic1a70daa667e23976b74d2303c823b8d8c7bcb2b
The hexint modparam type became available in 5.10.
The stream_open() function became available at some point in 5.0.x.
Closes#1431
Change-Id: I4965d05a2c4c0f0bf526ea0bf3f76f5ca2f9dff6
The main kernel interface has no concept of file position, therefore it
makes no sense to keep the additional overhead of ensuring an atomic
file position. Calling stream_open disables the FMODE_ATOMIC_POS flag
which in turn disables the extra locking for the fpos.
Change-Id: I14c37c3894791126aaf9caa0695da654a2012261
The per-table /proc files may contain sensitive information. Add an
optional file mode mask to apply to the top directly to hide it from
unprivileged users.
Change-Id: I3ec02739e0d97e53c8628259922ccf64ddfa8415