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
Make the skb copy only once we know that it's for a known target.
Implies a rework of some of the early-return gotos.
No functional change.
Change-Id: Ibf5d09c0df2a91cfb50f3181e80114539e4f50a6
Make the skb copy within the worker function instead of its callers.
Combines two identical pieces of code into one.
No functional change.
Change-Id: I9ee97c8a2588ca9f88e79b92a9fa880feaa8e156
Use the existing offsets to network/transport header to determine how
much needs to be pulled back. Then we can combine these code snippets
into one.
No functional change.
Change-Id: I34eeb707da9baad0891d2fbb2d8d9fc95e027204
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
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
If the dumper was not opened, then also take care
to clear the recording path, because later
the `response_pcap()` only checks the recording path
itself and not wehther the dumper was actually opened.
Hence NG would report a recording file, which indeed
was never even created.
For consistency reasons add the dumper's guard
in the `response_pcap()`.
Change-Id: Ifc1d5b73785633ffcc6293d64dbfbdea51b54582
The `finish_proc()` misses part of the clean-up
work if the kernel table isn't open.
Only `kernel_del_call()` really depends
on the `kernel.is_open`, local cleanup should still happen.
Change-Id: I8f999dbc48f7dd04b4ca1ba5edbc9218a3c49d29
When setting up streams, we currently check the pointer itself,
whether the kernel table isn't open, an existing stream index
and the `NO_RECORDING` flag.
Check additionally whether the recording call
was actually registered in the kernel.
Otherwise if the `proc_init()` fails to to add call
to the kernel recording interface, `setup_stream_proc()`
still tries to add the stream to the kernel.
Change-Id: Ibaf25d1f91f9818325e3e9f7be3316610f5c63be
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
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