| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This fixes compilation on e.g. macOS and FreeBSD, where it is missing.
|
|
|
|
|
|
| |
nice_address_to_string expects an already-allocated string, which is not
great for introspection. Adds nice_address_to_string_dup, which does the
same thing, but returns a newly allocated string.
|
|
|
|
| |
Even if the TCP candidates are disabled.
|
|
|
|
|
| |
This should enable having servers that do both IPv4 and IPv6. And
ideally should make life easier for app developers.
|
|
|
|
|
| |
This should enable having servers that do both IPv4 and IPv6. And
ideally should make life easier for app developers.
|
|
|
|
|
| |
The checks were reversed, requiring for instance a non-relay candidate
for calling nice_candidate_relay_address()
|
|
|
|
|
|
| |
Limit the number of stored incoming checks based on the property
limiting the number of total connectivity checks instead of using
the fixed limit on the number of remote candidates.
|
|
|
|
|
|
|
| |
This will find some interface that has the address and will not work
correctly if multiple interfaces have the same address. But in any
case, nothing in libnice expects that and we would need to break the
API to make that work.
|
|
|
|
|
|
| |
Bug reported and fix suggested by Masato Takahashi
Fixes #164
|
|
|
|
| |
This should make the library more easily usable for bindings
|
|
|
|
|
|
| |
One use case for this is adding an ALPN header which is a MUST
requirement when a HTTP proxy is used in WebRTC (see RFC8835, section
3.4).
|
|
|
|
| |
inbound STUN with NOMINATION attr
|
|
|
|
| |
keepalive
|
| |
|
|
|
|
| |
Can be useful to know which STUN server was used to discover the given candidate.
|
|
|
|
|
| |
There is a codepath where it can be used without being filled.
Found by coverity.
|
|
|
|
| |
Can be useful to know which TURN server is being used as relay server for a given candidate.
|
|
|
|
|
|
|
|
|
|
| |
It's possible that the callback will be called synchronously during the
close function, in this case, we need to be ready to the last reference
to the agent to be dropped in this callback.
This fix was suggested by Fabrice Bellet
Fixes #153
|
|
|
|
|
|
|
|
|
|
| |
If we have gathered a host IP-address that is link-local we should
never try to use it for anything else than trying to match it with
another link-local address. Some routers seem to have problems with
traffic from link-local addresses destined at external IP-addresses.
By definition link-local addresses should stay local so there's no
reason to access STUN/TURN from it or try to form a candidate with
another address that is not link-local.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
../agent/discovery.c: In function ‘on_refresh_remove_timeout’:
../agent/discovery.c:203:13: warning: Not available before 2.60
203 | G_GNUC_FALLTHROUGH;
| ^~~~~~~~~~~~~
../agent/conncheck.c: In function ‘priv_turn_allocate_refresh_retransmissions_tick_agent_locked’:
../agent/conncheck.c:1656:13: warning: Not available before 2.60
1656 | G_GNUC_FALLTHROUGH;
| ^~~~~~~~~~~~~
The comment /* fall through */ is enough to cause GCC and Clang to not
emit the implicit-fallthrough warning.
|
|
|
|
| |
This was probably added by mistake.
|
|
|
|
|
| |
In one case, the message pointer gets replaced by the rfc4571_message
one, so it wasn't getting cleared as expected.
|
|
|
|
| |
This was caught by tests randomly failing (timing out).
|
| |
|
|
|
|
| |
In case close() is called more than once.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
E.g. if the server address is IPv6 but the local system cannot reach it,
so connect() fails right away.
|
|
|
|
|
|
|
| |
The patch invokes the conncheck timer creation where it makes most
sense: when a new pair is inserted in the conncheck list, and when a
pair is added to the triggered check list (because the conncheck
scheduler works on these two lists).
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch ensures that related succeeded-discovered pairs change to
state failed simultaneously, to avoid leaving dangling pointers if one
is freeed while the other is still in the conncheck list. Such
transition is very rare, and only occurs in regular nomination mode,
when the network conditions change between the time the pair is
initially discovered and the time it is rechecked with the use-candidate
flag.
|
|
|
|
|
|
|
|
|
| |
Instead of having 3 independent implementations, make the simpler
versions delegate into the full one.
The simplest constructor needs to pass "no option", for which no
constant exists in the NiceAgentOption enum. Thus the new
NICE_AGENT_OPTION_NONE constant is added to reflect this possibility.
|
|
|
|
|
|
|
|
|
| |
The stun agent may contain references to the password previously stored
in some remote candidates, freeed by nice_component_restart(), that were
used by keep-alive stun requests. These stun replies may arrive later
after ice has been restarted. Since the remote candidates are freeed
when ice is restarted, the stun agent must be reset to get rid of these
related references.
|
|
|
|
| |
It's not released yet and we don't do even/odd in this project.
|
|
|
|
| |
Also update the Since to 0.1.19, because it's not really usable now
|
|
|
|
| |
Also update the Since to 0.1.19, because it's not really usable now
|
|
|
|
|
| |
The component can go from any state to FAILED, so simplify
that and make it explicit.
|
|
|
|
|
|
|
| |
When doing a ICE restart, which can be done from any state, we can
always go back into the gathering state.
This fixes a regression introduced by b20ac5ba7b731f2cc698f26e8def28a518de058e
|
|
|
|
| |
To be consistent with what we do for ICE-TCP.
|
|
|
|
| |
The type is already checked to not be peer reflexive earlier.
|
|
|
|
|
|
| |
Even if the agent is invalid, don't leak.
This makes coverity a little happier.
|
|
|
|
|
| |
This should make Coverity's job a little easier. And also fix a little
leak in the error path.
|
|
|
|
|
|
|
|
|
|
| |
With this patch we free all outstanding refreshes when the agent dispose
method is called, even those that are in the way to be discarded
asynchronously, when a stream is removed.
We also make the final user callback of the refresh proces synchronous,
so we don't have to deal with an heap use-after-free problem. This also
requires to order some parts of code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Asynchronous refreshes pruning may occur when the agent async close
function is called, but also when a stream is closed. A flag
'discarding' is used in the CandidateRefresh object to determine
if a refresh is already on the way to be asynchronously freed. A refresh
definitely freed is removed from agent refresh_list.
When the agent async close function is called, it is passed a user
callback that will be invoked when all refreshes have been freed.
This is not exactly how things work currently, because right now, the
callback function is also invoked when all CandidateRefresh objects have
the discarding flag set, with the test 'data->items_to_free==0'. In that
case, clearly not all refreshes have been freed, as some are still there
in the refresh_list with the discarding flag set.
This is probably not what the user expects from the function
nice_agent_close_async(), where the callback is supposed to be invoked
after all refreshes have been freed: and including those asynchronously
pruned by nice_prune_stream_async().
This patch adds a supplementary timeout when closing the agent async,
that waits until the agent refresh list becomes empty.
|
|
|
|
|
| |
We keep refreshes having the discarding flag set. They may be freed later
if the agent main context remains alive after agent deletion.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch suggests the developer to close its alive reservations on
the turn server before disposing the agent.
Not removing reservations on the turn server, will make them alive until
their default timeout, generally 300 seconds, which is not fair for the
turn server resources, but also it may cause a fatal error 437,
"Mismatched allocation: wrong transaction ID", when another agent tries
to contact the same turn server using the same nat mapping before this
delay expires.
|
|
|
|
|
| |
The reason is that the component object could have been destroyed in the
mean time.
|
| |
|
|
|
|
|
|
|
|
| |
Refreshes with zero lifetime sent over tcp transport may cause the
removal of the underlying socket when the remote peer closes the
connection taking our request into account. These refreshes must be
tracked and freeed on our side to avoid retransmission attempt on a
closed socket and a heap-use-after-free error in that case.
|
|
|
|
| |
Including unused utun devices.
|