| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
There might be multiple RFC4571-framed messages (or fragments thereof)
within a single TCP-TURN message. Make sure each NiceInputMessage
passed by the user into socket_recv_messages() gets exactly one RFC4571
frame, or remains empty if there aren't any messages to receive.
We should keep any data that doesn't fit into the user buffers for
the next time socket_recv_messages() gets called with the socket.
|
| |
|
|
|
|
|
|
| |
32-bit
Closes: ttps://gitlab.freedesktop.org/libnice/libnice/issues/45
|
|
|
|
|
|
|
|
|
|
|
|
| |
the first case of test-new-dribble (standard-test) is updated, by making
the credentials swap between the left and right agent asymmetric.
Previously, ragent started to receive stun requests without initially
knowing lagent candidates. Now, ragent also ignores lagent credentials.
This modification allows to test changes introduced by the previous
commit.
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D1890
|
|
|
|
|
|
| |
One or more streams might not have any connection check list if the
number of streams differs from the peer agent.
Differential Revision: https://phabricator.freedesktop.org/D1880
|
|
|
|
| |
Differential Revision: https://phabricator.freedesktop.org/D1888
|
|
|
|
|
|
|
|
|
| |
With this patch, we stash the controlling mode property change, and
apply it safely, when it won't interfere with an ongoing conncheck
running. According to RFC5245, sect 5.2. "Determining Role", the role
is determined for a session, and persists unless an ICE is restarted.
Differential Revision: https://phabricator.freedesktop.org/D1887
|
|
|
|
|
|
| |
Spotted by Lukas Gradl on the mailing list.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
|
|
|
|
| |
This code is not 1000 years old.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
|
|
| |
This makes it easier to read and more extensible.
|
|
|
|
| |
Differential Revision: https://phabricator.freedesktop.org/D1107
|
|
|
|
|
|
|
| |
https://phabricator.freedesktop.org/T104
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D1717
|
|
|
|
|
|
|
|
|
|
|
| |
This is required by the WebRTC spec.
Remove test-mainloop as it doesnt even try to do
a negotiation.
https://phabricator.freedesktop.org/T104
Differential Revision: https://phabricator.freedesktop.org/D1716
|
| |
|
|
|
|
| |
There was a confusion and it tested against a value not in the enum.
|
|
|
|
|
|
|
|
| |
Fixes a bug in the logic of the wait loop, where only a single
gathering done was required to exit the loop, the other was caught
by the following assert.
Differential Revision: https://phabricator.freedesktop.org/D1110
|
|
|
|
|
|
| |
In construct like "while (foo);" when foo is modified outside of the
current thread, the variable should be declared volatile to suggest the
compiler to read its value without making code optimization.
|
| |
|
|
|
|
|
|
|
|
| |
The header size should be 24 bytes only, if we don't want to fuzz the
payload too. Moreover, the default lambda parameter is decreased to
one, to not fuzz the header too heavily, and consequently increase too
much the time for the test to complete, due to exponential
retransmission timeout when packets are corrupted.
|
|
|
|
| |
This is recommended by RFC 6298
|
|
|
|
|
|
|
|
| |
Correct the behaviour of pseudo_tcp_socket_get_available_bytes() and
pseudo_tcp_get_available_send_space() when the socket is not in
TCP_ESTABLISHED state. It’s still permissible to send and receive up
until the local side calls pseudo_tcp_socket_close(), which means we
may be in state TCP_ESTABLISHED *or TCP_CLOSE_WAIT*.
|
|
|
|
|
|
|
|
|
| |
Previously, pseudo_tcp_socket_recv() would start returning 0 (EOS) as
soon as a FIN segment was received from the peer, even if there was
unread data already in the receive buffer.
Instead, the unread data should all be accessible before
pseudo_tcp_socket_recv() starts returning 0.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, if peer A transmitted one or more data segments (1),
followed by a FIN segment (2) to peer B, and segments 1 were
dropped, peer B would not request retransmission of them and would
instead continue with the FIN handshake. This effectively meant
segments 1 were lost without peer B realising.
Fix this by only handling the FIN segment once its sequence number is
acknowledged in the receive window.
|
|
|
|
|
| |
This test depends on rfc5766-turn-server which must
be installed for this test to run.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"new-selected-pair" may be emitted after "component-state-changed"
to READY, by which time the main loop might have gotten quit in
cb_component_state_changed(). Consequently, cb_new_selected_pair() could
miss to register the selected pair, ultimately leading to an assertion
failure in main().
We should wait for both selected pair and state change events to occur
before stopping the main loop.
Differential Revision: https://phabricator.freedesktop.org/D1044
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
• rename to nice_socket_is_based_on() and swap the order of arguments
accordingly; the implementation doesn't have to use the confusing
'return other->is_base_of()' pattern anymore
• fix potential NULL dereferences
The argument order in agent_recv_message_unlocked() was already wrongly
swapped in 1732c7d6 and thus this commit isn't changing it back because
that order has become the correct one.
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D866
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have to call is_base_of "virtual function pointer" of 'other'
object, not 'sock', since 'other' is the structure whose base
NiceSocket we need to get from its private data.
For instance calling nice_socket_is_base_of() with 'sock' and 'other'
being respectively pseudo-SSL and UDP-TURN-over-TCP invoked is_base_of
variant for pseudo-SSL, casting other->priv into PseudoSSLPriv *, but
other->priv is actually TurnTcpPriv *. It must be called the other way
around.
https://phabricator.freedesktop.org/T7335
https://phabricator.freedesktop.org/T7336
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: José Antonio Santos Cadenas <santoscadenas@gmail.com>
Reviewed-by: Philip Withnall <philip@tecnocode.co.uk>
Reviewed-by: José Antonio Santos Cadenas <santoscadenas@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D785
|
|
|
|
|
|
|
|
| |
The test didn't let enough time for ragent to reach the completed state
after obtaining its remote candidates and switching to connecting state.
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D817
|
|
|
|
|
|
|
|
|
| |
The local preference depends on the rank of the IP address in the list
of all IP addresses available of the box running the test. As this value
is not fixed we ignore it in the test.
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D818
|
|
|
|
|
|
|
|
|
| |
Now that we’re using automake’s parallel test harness, it automatically
redirects all the debug log spew away from the console, so we should
always have it enabled.
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D292
|
|
|
|
|
|
|
|
|
| |
This is a follow up to T3324, to update the test case to match the new
values generated.
Bug: https://phabricator.freedesktop.org/T3324
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D301
|
|
|
|
|
|
|
| |
Now we can actually see the priority numbers which are unequal.
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D300
|
|
|
|
|
|
|
|
| |
This avoids an assertion failure in nice_address_to_string() when the
addresses are compared for priority.
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D299
|
|
|
|
|
|
|
|
| |
We depend on GLib 2.36.0, which is a higher version than any of these
version checks cared about, so they were all trivially true or false.
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D298
|
|
|
|
|
|
|
|
| |
We depend on GLib 2.36.0; g_thread_init() has been deprecated since
2.32.0, when thread initialisation was changed to happen automatically.
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D297
|
|
|
|
|
|
|
|
| |
We depend on GLib 2.36.0, which deprecated g_type_init() since GType
initialisation is now done automatically.
Reviewed-by: Olivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D296
|
|
|
|
| |
Adds new API: nice_agent_set_local_credentials().
|
|
|
|
| |
https://bugs.freedesktop.org/show_bug.cgi?id=89609
|
|
|
|
| |
Makes the test code a little clearer. Introduces no functional changes.
|
|
|
|
| |
If n_messages ≠ n_valid_messages.
|
| |
|
|
|
|
| |
To be used with `make check-valgrind`.
|
|
|
|
|
| |
The theory being that if we can get check-valgrind to pass, we could
acutally use it to find more memory leaks and other errors in the agent.
|
|
|
|
| |
There is no need for this to be heap-allocated.
|
|
|
|
| |
From commit 7b6935c66738d855c84fba291d47ece6ce1c43e2.
|
|
|
|
|
|
|
|
| |
This allows FIN–ACK support to be disabled entirely. This is mostly for
testing purposes, since TCP_OPT_FIN_ACK is negotiated when establishing
the connection, and is disabled if the other side doesn’t support it.
This includes an interoperability test.
|
|
|
|
| |
As found by tsan.
|
|
|
|
|
|
|
|
| |
This explicitly removes all timers and main loop considerations from the
pseudo-TCP testing, which considerably simplifies arranging packet swaps
and mistimings for testing purposes.
This test suite includes a few tests for the FIN–ACK support.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to detect cases where the peer closes its connection without an
explicit in-band close message (e.g. in protocols such as Telnet where
there is none), pseudo-TCP needs to grow support for a shutdown
handshake, following the TCP FIN–ACK specification. Arguably it should
have had this all along, but Jingle apparently doesn’t need it.
This adds support for FIN–ACK to the pseudo-TCP implementation. It is
backwards-compatible, only being used if the TCP_OPT_FIN_ACK option is
specified in the SYN segment.
If enabled, full-duplex closes are supported, and the standard method
for notifying a peer of the other end closing its connection (returning
0 from recv()) is used.
Also allow rapidly tearing down a connection, discarding unsent and
unreceived data, by sending an RST segment. This preserves the ability to
do a forced socket closure with pseudo_tcp_socket_close(sock, TRUE).
It also permits graceful socket shutdown in the case where the final ACK
is lost, and one peer gets stuck in the LAST-ACK state: that peer will
eventually re-transmit its FIN segment. The other peer, in the CLOSED
state, will respond with a RST segment, and the first peer will then
reach CLOSED.
References (most useful first):
• http://tools.ietf.org/html/rfc793#section-3.5
• http://tools.ietf.org/html/rfc1122#page-87
• http://vincent.bernat.im/en/blog/2014-tcp-time-wait-state-linux.html
• http://tools.ietf.org/html/rfc675
Diagram:
•
http://en.wikipedia.org/wiki/Transmission_Control_Protocol#mediaviewer/File:TCP_CLOSE.svg
|
| |
|