| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes issue found by Coverity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this patch we ensure that local socket errors during connection
establishment are properly transmitted to the connection check layer, so
the related pair can be put in state failed when needed. The local
socket errors we are interested in, are those occuring when the local
source address cannot be bound anymore, because the underlying interface
vanished for example.
In particular, we don't ignore errors coming from g_socket_bind() with
tcp active sockets, that perform a bind to *whatever* local address is
available, in case it cannot bind to the specified address.
This behaviour was demonstrated with the test-tcp example, that tried
to bind to the IPv4 loopback address on a socket initially created for
the IPv6 loopback.
|
| |
|
| |
|
|
|
|
|
| |
As removing the request from the queue looks into the SendRequest, one
needs to unqueue it before freeing it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes cases, where the range is full, some ports fail with
HOST_CANDIDATE_CANT_CREATE_SOCKET, other fail with
HOST_CANDIDATE_DUPLICATE_PORT, the value of res we keep when leaving the
loop is randomly the one of the last iteration of the loop.
CANT_CREATE_SOCKET still happens when trying to create an udp bsd socket
with the same address and port than one of another component, so it is
also a case of duplicate port in fact.
To be homogeneous, we add a gerror for nice_udp_bsd_socket_new(), like
we did in nice_tcp_passive_socket_new(), and we can catch the same
G_IO_ERROR_ADDRESS_IN_USE there too, when failing to get free available
udp ports.
This patch is a complement to merge request !158
|
|
|
|
|
|
|
| |
This will make it fail if either our test of UDP port clash fails
or if the kernel rejects the new socket because there is a port clash.
Also include a unit test for this.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Remove dist check on the CI, since it doesn't really
add anything in the Meson case (tarball is based
on files checked into git and srcdir != builddir).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The same code to get and validate local and remote candidates from an
incoming stun is shared between regular inbound stun, early checks
replay, and partially in the local peer-reflexive discovery function.
The selection of the matching local and remote candidate from an
incoming stun sometimes requires more information than just the local
socket, and the sender address and port. It happens more frequently when
the port range is reduced, and when the conncheck handles both tcp and
udp candidates.
To help to disambiguate such situations, we add supplementary checks
when two candidates in the list have the same address and and port
number:
* the type of the socket must compatible with the candidate transport.
A socket for a tcp candidate may be active of passive, but also
of type "tcp-bsd" when the parent active or passive socket is
replaced after a bind() or accept(). It gives several cases.
* the remote candidate transport and the local candidate transport must
be compatible
|
|
|
|
| |
Errors found by coverity
|
| |
|
|
|
|
|
| |
The IPv6 struct sockaddr variant is bigger than the IPv4 one,
so use the storage struct to ensure that the size is big enough.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
https://gitlab.freedesktop.org/libnice/libnice/commit/da41258a21102f63ec5d5b2dc20d303f772eb195. Fix #64.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The underlying GSocket implementation on Windows returns an error when
the user-provided buffer isn't large enough to fit the whole datagram
received on a message-oriented socket.
When this occurs, in order to preserve identical behavior of udp-bsd
NiceSocket across platforms, we have to mute the error and set the
received message length to the size of the provided NiceInputMessage.
Any excess portion of the message gets discarded.
Fixed udp-bsd test on Windows.
GLib 2.48 is required in order to use G_IO_ERROR_MESSAGE_TOO_LARGE.
|
|
|
|
| |
Tested inside Cerbero with VS 2017
|
| |
|
|
|
|
|
|
|
| |
If this isn't done, then there may be invalid points left inside the
passive socket which could be used and cause a crash.
Fixes #33
|
|
|
|
|
|
|
|
| |
Avoids race between socket_send_more() and socket_close() leading either
to crash on use of freed NiceSocket, or abort upon attempting to
g_mutex_clear() a locked mutex.
Akin to what d1611c0c0ba6c5bce500b96a8f61de4fe5f144e9 did to udp-turn.
|
|
|
|
| |
To be able to call it from a context that is already locked.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
After being parsed, a TURN control message turns into a NiceInputMessage
with zero length. Such message doesn't increment the iteration counter i
and so is re-processed in the next iteration, which detects right away
that message->length == 0 and continues to the next element in
recv_messages.
Thus, n_valid_messages variable serves no real purpose and to achieve
the same result we can simply increment the iteration counter after each
message.
|
| |
|
|
|
|
|
| |
The socket abstraction not being reference counted, we need a global
lock for them in the short term.
|
|
|
|
| |
It's not locked in any way.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Work on libnice's bug #1 in Gitlab. This work is composed of multiple
merged parts:
- "Global lock contention removed"
Phabricator D1900: https://phabricator.freedesktop.org/D1900
By @nifigase
Opened in GitLab as Merge Request !12
- "agent: properly handle NiceAgent ref in callbacks from timeout
sources"
Phabricator D1898: https://phabricator.freedesktop.org/D1898
By @mparis
This patch was itself based upon a previous version of the work done in
D1900. After the switch of hosting, it got lost.
On top of these, additions to follow some review comments from @ocrete:
- https://phabricator.freedesktop.org/D1900#40412
- https://phabricator.freedesktop.org/D1898#39332
|
|
|
|
|
|
|
|
|
| |
There was two cases where instead of freeing the queue, we actually
clear the queue so it's ready for reused. Notably in
nice_socket_free_send_queue(), a missed name function and nicesrc
element state change.
This regression was introduced by: fa783b1dd727a6ee2b99a111ca24790ae850c2f7
|
|
|
|
|
|
| |
This is new warning introduced with GCC 8. This is being fixed by using appropriate function, like g_queue_free_full/g_list_free_full or by casting to GCallback before casting to the target function signature.
Closes: #46
|
| |
|
|
|
|
| |
Various little things, none of which should make a functional difference.
|
| |
|
|
|
|
| |
This makes clang happy.
|
|
|
|
|
|
|
| |
Those may have previously been silently ignored.
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D1708
|
|
|
|
|
| |
Cleanly returnign makes no sense and may hide
worse problems.
|