platform/upstream/libnice.git
5 years agoudp-bsd: Use sockaddr_storage union to ensure big enough socket
Olivier Crête [Sun, 28 Jul 2019 15:33:16 +0000 (11:33 -0400)]
udp-bsd: Use sockaddr_storage union to ensure big enough socket

The IPv6 struct sockaddr variant is bigger than the IPv4 one,
so use the storage struct to ensure that the size is big enough.

5 years agodiscovery: Don't start STUN/TURN disco on errorneous socket
Jakub Adam [Tue, 16 Jul 2019 09:55:32 +0000 (11:55 +0200)]
discovery: Don't start STUN/TURN disco on errorneous socket

If the initial attempt at sending discovery message returns a socket
error, don't start the retransmit timer and immediately mark such
discovery item as done. This is to quickly eliminate clearly
non-functioning items from the discovery process.

Particularly improves times to finish discovery on Windows, where
sending data from a link-local (169.254.0.0/16) IP to a destination not
on the same subnet leads to "A socket operation was attempted to an
unreachable network" error. Pointless retransmissions on those sockets
prolonged discovery in the order of seconds.

5 years agoudp-bsd: log source and destination addresses on GSocket send error
Jakub Adam [Tue, 16 Jul 2019 08:53:54 +0000 (10:53 +0200)]
udp-bsd: log source and destination addresses on GSocket send error

5 years agoagent: fix server-reflexive candidates with oc2007r2
Fabrice Bellet [Fri, 19 Jul 2019 07:58:34 +0000 (07:58 +0000)]
agent: fix server-reflexive candidates with oc2007r2

The nomination of a pair having such a local candidate breaks SfB when
the libnice agent is behind a nat that does not do port mapping
randomization. In that case a server reflexive local candidate usually
lead to a nominated pair.

The guess made here from observing this behavior is that, it is valid to
discover and signal these local server reflexive candidates to our peer,
but they should be removed from our local candidates list thereafter, so
they do not contribute to build a valid and *even worse* a nominated
pair with the type server-reflexive. They do not appear in the conncheck
list per design anyway.

Instead, the same candidate is discovered again later during the
conncheck, with a peer-reflexive type this time, and with that type, it
just works.

Closes #90

5 years agoconncheck: avoid transport association mismatch
Fabrice Bellet [Fri, 12 Jul 2019 14:06:13 +0000 (14:06 +0000)]
conncheck: avoid transport association mismatch

In some rare cases, the same address and port number may match two
remotes candidates, a tcp and an udp one, and lead to buggy pair
construction with incompatible transport. This supplementary check
prevents this problem. The matching test is not aimed to be exhaustive
but just a way to discard obviously broken associations, and fallback to
accept everything else (because socket type has a great diversity, with
socket types based on other sockets types).

It should fix #81, where such bogus transport association has been
reported (tcp-pass:udp).

5 years agointerfaces: ignore only interfaces we really want to
Jakub Adam [Fri, 12 Jul 2019 10:15:14 +0000 (12:15 +0200)]
interfaces: ignore only interfaces we really want to

Once an interface got ignored, ALL interfaces coming after it were
dropped too.

5 years agocandidate: replace uint8_t -> guint8
Jakub Adam [Fri, 12 Jul 2019 08:47:50 +0000 (10:47 +0200)]
candidate: replace uint8_t -> guint8

Fixes MSVC build.

5 years agodebug: fix verbose mode
Jakub Adam [Fri, 12 Jul 2019 08:30:39 +0000 (10:30 +0200)]
debug: fix verbose mode

Since g_parse_debug_string() was looking only at the first 4 items in
GDebugKey arrays, "libnice-verbose" couldn't get activated.

5 years agoexamples: fix compiler extra warnings
Fabrice Bellet [Tue, 9 Jul 2019 13:17:12 +0000 (15:17 +0200)]
examples: fix compiler extra warnings

5 years agoagent: fix condition for turn-tcp discovery creation
Fabrice Bellet [Wed, 3 Jul 2019 20:09:03 +0000 (22:09 +0200)]
agent: fix condition for turn-tcp discovery creation

We support turn-tcp in oc2007 compatibility only and when the
host candidate transport is compatible, ie when reliable_tcp is true.

5 years agoconncheck: test inbound stun address on the candidate base address
Fabrice Bellet [Wed, 12 Jun 2019 19:44:48 +0000 (21:44 +0200)]
conncheck: test inbound stun address on the candidate base address

When receiving an stun packet on a socket, and looking for the matching
local candidate, normally it doesn't make a difference to test the
address or the base address. Because a pair cannot have a local candidate
of type srv-rflx, where there would be a difference, the local candidate
obtained will be part of a pair of the conncheck list.

Except for the case of a pairs with tcp-act local candidate, where the
addr has a port number of zero (tcp-act socket before connect), and the
socket of the stun packet has a non-null port number (tcp-act socket
after connect), corresponding to the base address of another
peer-reflexive tcp-act local candidate, previously discoverd.

The selection of the local candidate concerned by an inbound stun
request happens when early incoming checks are processed, and when
inbound stun packets are normally received during the conncheck.

This commit complete commit e6a1941 (for early incoming checks)
in the normal inbound stun packets code path, where is similar
modification is needed.

5 years agoconncheck: improve comment on local peer-reflexive selection
Fabrice Bellet [Tue, 4 Jun 2019 17:34:22 +0000 (19:34 +0200)]
conncheck: improve comment on local peer-reflexive selection

This patch rewrites the comment surrounding this code snippet, to make it
clear, that this pair selection is not specific to the tcp transport.

5 years agoconncheck: nominate matching pairs across components and streams
Fabrice Bellet [Thu, 11 Jul 2019 19:02:53 +0000 (19:02 +0000)]
conncheck: nominate matching pairs across components and streams

The current valid pair nomination makes no effort to select pairs that
could have some similarities across different components and different
streams. This is normally not required by the RFC8445, but some well
known applications will misbehave when the libnice agent is in this
position to choose the nominated pairs (regular nomination mode, and
controlling mode) and if it makes an unexpected choice from the peer
point-of-view.

This patch improves the stopping criterion and the selection of the
preferred pair to nominate in that case.

When no other pair has been nominated yet (across all streams), the
previous stopping criterion still applies, and the best ranked pair of
the checklist is selected.

When a nominated pair exists from another component, we try to nominate
a pair of the same kind (same local and remote addresses and same
transport) if we have one, and possibly the best pair we have in the
checklist, and else we look for a nominated pair from another stream.

5 years agoagent: fix agent reference count
Fabrice Bellet [Sun, 30 Jun 2019 19:28:25 +0000 (21:28 +0200)]
agent: fix agent reference count

5 years agotests: fix a compiler warning
Fabrice Bellet [Fri, 28 Jun 2019 13:35:41 +0000 (15:35 +0200)]
tests: fix a compiler warning

5 years agotcp-bsd: fix a heap-use-after-free
Fabrice Bellet [Fri, 28 Jun 2019 11:54:57 +0000 (13:54 +0200)]
tcp-bsd: fix a heap-use-after-free

5 years agocomponent: don't detach the socket source twice
Fabrice Bellet [Fri, 28 Jun 2019 11:49:47 +0000 (13:49 +0200)]
component: don't detach the socket source twice

The source is also detached in socket_source_free()

5 years agoconncheck: define a property for a final idle timeout
Fabrice Bellet [Fri, 28 Jun 2019 11:45:11 +0000 (13:45 +0200)]
conncheck: define a property for a final idle timeout

This final idle timeout is renamed from the
NICE_AGENT_MAX_TIMER_GRACE_PERIOD macro, and keeps its semantic.

We also increase the default value of this timeout from 1 second to 5
seconds.  This is useful for the sipe pidgin plugin that has to deal
with SfB agents, that may take some time in controlling mode before
choosing and testing the nominated pair

5 years agoconncheck: fix pair priorities uniqueness
Fabrice Bellet [Tue, 25 Jun 2019 07:19:05 +0000 (09:19 +0200)]
conncheck: fix pair priorities uniqueness

This patch fixes the priority assigned to a peer reflexive discovered
local candidate, when the agent has the stun client role and receives an
stun reply. This priority must be the value put in the stun request, ie
the pair->rflx_priority from the parent pair. This ensures two similar
ordered pairs, will generate discovered pairs ordered in the same way
for the stun client, and also for the stun server on the other side.
Without this identical ordered on both sides of the connections, the two
agents may nominate a different pair with the aggresive nomination
scenario, since both are valid.

The other fix concerns the function that ensures local candidates
priority uniqueness, that breaks the assumption that "two local
candidates having the same priority should generate the same
prflx_priority in the pairs they contribute". Respecting this assumption
is important to stay coherent with the behavior of the other agent, that
considers that two stun requests coming from the same peer-reflexive
remote candidate will have the same remote priority (once a remote
candidate is added to the component remote_candidates list, its priority
is not supposed to change).

5 years agoconncheck: create the valid pair on early tcp stun requests
Fabrice Bellet [Sat, 22 Jun 2019 21:09:45 +0000 (23:09 +0200)]
conncheck: create the valid pair on early tcp stun requests

When replaying the incoming checks, we have to create the succeeded
valid pair matching this tcp connection the same way we do it
in conn_check_handle_inbound_stun().

5 years agoagent: discard sockptr on updated remote candidates
Fabrice Bellet [Fri, 21 Jun 2019 13:06:58 +0000 (15:06 +0200)]
agent: discard sockptr on updated remote candidates

These candidates type is updated from peer-reflexive, discovered during
early incoming checks, to the type of the matching regularly transmitted
candidate, so the previous sockptr value is no longer of interest here.
The same socket is already associated to the initial local candidate
anyway, source of the early discovery.

5 years agocomponent: remove socket also from remote candidates
Fabrice Bellet [Tue, 18 Jun 2019 18:54:16 +0000 (20:54 +0200)]
component: remove socket also from remote candidates

A socket to be removed may also come from a peer-reflexive remote
candidate, and some cleanup also needs to be done in this case. This
reference in a remote peer-reflexive tcp-active candidate caused a
heap-use-after-free asan error in some custom debugging dump of the list
of sockets of a component, after a read error in component_io_cb():

agent_recv_message_unlocked returned -1, errno (25) :
Inappropriate ioctl for device

5 years agodebug: fix verbose debug enable
Fabrice Bellet [Sun, 16 Jun 2019 20:05:49 +0000 (22:05 +0200)]
debug: fix verbose debug enable

5 years agoconncheck: fix incoming checks memory leak
Fabrice Bellet [Sun, 16 Jun 2019 19:04:41 +0000 (21:04 +0200)]
conncheck: fix incoming checks memory leak

5 years agoconncheck: test incoming checks on candidate base address
Fabrice Bellet [Wed, 12 Jun 2019 19:44:48 +0000 (21:44 +0200)]
conncheck: test incoming checks on candidate base address

The candidate may be a newly discovered peer reflexive one,
or a server reflexive initial candidate, where address and
base address differ. Early incoming checks are received on
the base address. These incoming checks may accumulate if remote
credentials arrive with a delay.

5 years agosocket: fix a heap use-after-free on the send queue
Fabrice Bellet [Wed, 12 Jun 2019 13:58:41 +0000 (15:58 +0200)]
socket: fix a heap use-after-free on the send queue

5 years agoconncheck: increase dumped information in debug
Fabrice Bellet [Wed, 12 Jun 2019 13:56:02 +0000 (15:56 +0200)]
conncheck: increase dumped information in debug

In complement to the conncheck list, we dump the pair transport type,
the socket type, and the incoming checks list.

5 years agoconncheck: make oc2007r2 mode more rfc5245 friendly
Fabrice Bellet [Wed, 12 Jun 2019 12:50:35 +0000 (14:50 +0200)]
conncheck: make oc2007r2 mode more rfc5245 friendly

5 years agoagent: more debug when remote credential are received
Fabrice Bellet [Fri, 7 Jun 2019 21:06:04 +0000 (23:06 +0200)]
agent: more debug when remote credential are received

This complete the similar debug trace when remote candidates are
received, and help to debug our tests with the patched farstream
library, where candidates and credentials are transmitted with a
random delay.

5 years agoagent: signal when a selected pair foundation is updated
Fabrice Bellet [Fri, 7 Jun 2019 20:55:14 +0000 (22:55 +0200)]
agent: signal when a selected pair foundation is updated

This foundation update may be needed when a selected pair contains a remote
candidate that has been found by an inbound stun request, but has not
been received by nice_agent_set_remote_candidates()

5 years agonicesrc: fix a leak spotted by asan
Fabrice Bellet [Fri, 7 Jun 2019 20:25:56 +0000 (22:25 +0200)]
nicesrc: fix a leak spotted by asan

5 years agoexamples: fix compiler warning about uninitialized variables
Fabrice Bellet [Fri, 7 Jun 2019 20:12:52 +0000 (22:12 +0200)]
examples: fix compiler warning about uninitialized variables

5 years agoRevert "conncheck: Don't lookup prflx pair for UDP candidates"
Fabrice Bellet [Tue, 4 Jun 2019 17:34:22 +0000 (19:34 +0200)]
Revert "conncheck: Don't lookup prflx pair for UDP candidates"

This reverts commit ca47519feda9d4dad38a06e2f7d94c0afc501364.

5 years agocomponent: Fix use-after-free and resolve regression
Fabrice Bellet [Sun, 9 Jun 2019 15:34:16 +0000 (17:34 +0200)]
component: Fix use-after-free and resolve regression

conn_check_prune_socket() on nsocket must be called before removing the
candidate with this socket inside the loop, to prevent the
use-after-free reported initially in issue #73.

But commit 541801d introduced a regression during discovery when an udp
turn over tcp socket is immediately closed by a HUP condition for
example. In this case, discovery_prune_socket() is never called, because
we don't have a candidate with this socket inside the loop. So the
nsocket is freed by the final nice_component_detach_socket() but is
still used by the discovery timer callback.

This commit moves the discovery_prune_socket() and
conn_check_prune_socket() actions before the loop instead of after, or
inside.

Closes #73

5 years agoagent: fix a memory leak
Fabrice Bellet [Sun, 16 Jun 2019 16:39:39 +0000 (18:39 +0200)]
agent: fix a memory leak

5 years agoagent: keep a ref on the agent while removal of TURN refreshes
Fabrice Bellet [Sun, 19 May 2019 21:50:25 +0000 (23:50 +0200)]
agent: keep a ref on the agent while removal of TURN refreshes

The patch makes the agent alive at least until the last callback of
the removal of turn refreshes when a stream is deleted from the agent.

Closes #84

5 years agodiscovery: fix an use-after-free in SFB user credentials
Fabrice Bellet [Sun, 9 Jun 2019 11:13:43 +0000 (13:13 +0200)]
discovery: fix an use-after-free in SFB user credentials

The base64 decoded username and password strings given to
stun_usage_turn_create() should not freed immediately, since they remain
used when handling the following related inbound stun replies.

5 years agomeson: Fix enum types generation to match automake
Olivier Crête [Wed, 3 Jul 2019 19:17:26 +0000 (15:17 -0400)]
meson: Fix enum types generation to match automake

The automake generated ones are a little funky, so the meson one have to also be
to not break API...

5 years agoagent: add nice_agent_get_sockets API
Olivier Crête [Fri, 28 Jun 2019 21:03:44 +0000 (17:03 -0400)]
agent: add nice_agent_get_sockets API

This API makes it possible to get an array of all of the sockets used
by a specific component, this is useful to set options on the socket.

Also bump GLib requirement to 2.54, which is the version in RHEL 7

5 years agoconncheck: add transport information to debug
Fabrice Bellet [Thu, 27 Jun 2019 19:52:13 +0000 (19:52 +0000)]
conncheck: add transport information to debug

5 years agobuild: add default ignore network interface prefix
Stefan Becker [Thu, 27 Jun 2019 10:33:25 +0000 (13:33 +0300)]
build: add default ignore network interface prefix

By default libnice now ignores network interfaces from virtual machines
and containers, i.e. names that start with "docker", "veth", "virbr" and
"vnet".

If you want to disable this feature override the default with

       ./configure --without-ignored-network-interface-prefix ...
       ./configure --with-ignored-network-interface-prefix= ...
       meson setup -D ignored-network-interface-prefix= ...
       meson setup -D ignored-network-interface-prefix=[] ...

5 years agoconfigure: support --without-ignored-network-interface-prefix
Stefan Becker [Thu, 27 Jun 2019 09:41:06 +0000 (12:41 +0300)]
configure: support --without-ignored-network-interface-prefix

This fixes commit b4abda09c79e4ce372a3771300abf568c85c7ff5

--without-XXX sets $withval to "no", hence we must check for this special
value instead of ignoring network interfaces that start with "no".

5 years agobuild: make prefix option accept a list of strings
Stefan Becker [Thu, 27 Jun 2019 09:22:53 +0000 (12:22 +0300)]
build: make prefix option accept a list of strings

The parameter for the ignored network interface prefix build option
accepts a comma-separated string now. This list will be converted to a
comma-separated list of string literals for the C code.

Disable the feature:

   ./configure ...
   ./configure --with-ignored-network-interface-prefix= ...
   meson setup -D ignored-network-interface-prefix= ...
   meson setup -D ignored-network-interface-prefix=[] ...

Ignore interfaces whose names start with "virbr":

   ./configure --with-ignored-network-interface-prefix=virbr ...
   meson setup -D ignored-network-interface-prefix=virbr ...

Ignore interfaces whose names start with "virbr" or "veth":

   ./configure --with-ignored-network-interface-prefix=virbr,veth ...
   meson setup -D ignored-network-interface-prefix=virbr,veth ...

5 years agointerfaces: allow list of ignored prefixes
Stefan Becker [Thu, 27 Jun 2019 09:17:43 +0000 (12:17 +0300)]
interfaces: allow list of ignored prefixes

Improve on commit b4abda09c79e4ce372a3771300abf568c85c7ff5

Instead of checking one prefix, check against a list of prefixes. This
allows libnice to be configured to ignore interfaces from virtual
machines and containers.

5 years agointerfaces: ignore non-running interfaces
Stefan Becker [Wed, 26 Jun 2019 09:00:21 +0000 (12:00 +0300)]
interfaces: ignore non-running interfaces

Check for IFF_UP and IFF_RUNNING flags on the interface.

5 years agotests: ignore trickle executables
Stefan Becker [Wed, 26 Jun 2019 08:59:04 +0000 (11:59 +0300)]
tests: ignore trickle executables

This fixes commit 9afd0c8b8f12aa560f800ced7e50b4da40dea456

5 years agointerfaces: detect IPv6 ULA & link-local addresses
Stefan Becker [Wed, 26 Jun 2019 08:45:06 +0000 (11:45 +0300)]
interfaces: detect IPv6 ULA & link-local addresses

Update nice_interfaces_is_private_ip() to handle IPv6 too:

- unique local address block: fc00::/7
- link-local address block:   fe80::/10

5 years agointerfaces: add missing support for IGNORED_IFACE_PREFIX
Stefan Becker [Wed, 26 Jun 2019 08:08:37 +0000 (11:08 +0300)]
interfaces: add missing support for IGNORED_IFACE_PREFIX

This fixes commit b4abda09c79e4ce372a3771300abf568c85c7ff5

Copy the implementation to the !HAVE_GETIFADDRS branch too.

5 years agointerfaces: support multiple loopbacks
Stefan Becker [Wed, 26 Jun 2019 08:00:25 +0000 (11:00 +0300)]
interfaces: support multiple loopbacks

Clone implementation from HAVE_GETIFADDRS branch to !HAVE_GETIFADDRS
branch of nice_interfaces_get_local_ips()

5 years agoAssign source out of the for loop
alex [Wed, 5 Jun 2019 09:45:17 +0000 (11:45 +0200)]
Assign source out of the for loop

5 years agoFix regression introduced by https://gitlab.freedesktop.org/libnice/libnice/commit...
alex [Tue, 21 May 2019 14:19:32 +0000 (16:19 +0200)]
Fix regression introduced by https://gitlab.freedesktop.org/libnice/libnice/commit/da41258a21102f63ec5d5b2dc20d303f772eb195. Fix #64.

5 years agoconncheck: Don't lookup prflx pair for UDP candidates
Jakub Adam [Wed, 29 May 2019 18:10:40 +0000 (20:10 +0200)]
conncheck: Don't lookup prflx pair for UDP candidates

Code comment mentions peer reflexive candidate pair should be selected
only in the case of TCP local candidates, but it was done in all cases.

5 years agomeson: Fix build with MSVC and non-English locale
Seungha Yang [Mon, 20 May 2019 15:22:36 +0000 (00:22 +0900)]
meson: Fix build with MSVC and non-English locale

Otherwise, MSVC will complain and cause build error.

5 years agoDeploy documentation
Olivier Crête [Fri, 10 May 2019 05:23:39 +0000 (01:23 -0400)]
Deploy documentation

5 years agoVersion 0.1.16.1
Olivier Crête [Thu, 9 May 2019 18:01:07 +0000 (14:01 -0400)]
Version 0.1.16.1

5 years agoVersion 0.1.16 0.1.16
Olivier Crête [Thu, 9 May 2019 17:18:13 +0000 (13:18 -0400)]
Version 0.1.16

5 years agogst: Fix URI in plugin
Olivier Crête [Thu, 9 May 2019 16:44:45 +0000 (12:44 -0400)]
gst: Fix URI in plugin

5 years agoagent: Replace closed signal with GASyncResult type function
Olivier Crête [Wed, 8 May 2019 20:40:10 +0000 (16:40 -0400)]
agent: Replace closed signal with GASyncResult type function

This makes the API more GIO style

5 years agoagent: add nice_agent_close_async() API
Jakub Adam [Mon, 25 Feb 2019 10:30:10 +0000 (11:30 +0100)]
agent: add nice_agent_close_async() API

Asynchronously closes resources the agent has allocated on remote
servers.

5 years agoagent: Add "closed" signal
Jakub Adam [Mon, 25 Feb 2019 10:23:22 +0000 (11:23 +0100)]
agent: Add "closed" signal

5 years agodiscovery: Asynchronous removal of TURN refreshes
Jakub Adam [Tue, 19 Feb 2019 10:24:06 +0000 (11:24 +0100)]
discovery: Asynchronous removal of TURN refreshes

When deleting a turn refresh, ensure the assocaited port allocations on
the TURN server are properly removed. This means wait for a response for
our 0-lifetime refresh request and implement retransmissions. Only
delete the refresh after TURN port removal has been confirmed or all
our retransmissions timed out.

5 years agocomponent: Refactor nice_component_clean_turn_servers()
Jakub Adam [Thu, 21 Feb 2019 14:54:06 +0000 (15:54 +0100)]
component: Refactor nice_component_clean_turn_servers()

First collect the relay candidates, then dispose them in a loop.

5 years agodiscovery: Remove unused refresh_prune_socket()
Jakub Adam [Wed, 20 Feb 2019 15:18:54 +0000 (16:18 +0100)]
discovery: Remove unused refresh_prune_socket()

5 years agoagent: G_GNUC_FALLTHROUGH macro for compatibility with older glib
Jakub Adam [Tue, 19 Feb 2019 10:21:07 +0000 (11:21 +0100)]
agent: G_GNUC_FALLTHROUGH macro for compatibility with older glib

5 years agoconncheck: NOMINATION STUN attribute support
Andrey Skryabin [Tue, 6 Nov 2018 12:34:10 +0000 (15:34 +0300)]
conncheck: NOMINATION STUN attribute support

Attribute is proposed here: https://tools.ietf.org/html/draft-thatcher-ice-renomination-00
WebRTC supports this attribute: controlling side provides attribute value increased by one each time selected pair is changed:
https://chromium.googlesource.com/external/webrtc/+/3c7d599750405bc734e1d5adbf1b54265b725a9d/p2p/base/p2ptransportchannel.cc#1821

5 years agoAdded OPENSSL_LDFLAGS
illya_dudchenko [Fri, 5 Apr 2019 10:07:17 +0000 (12:07 +0200)]
Added OPENSSL_LDFLAGS

5 years agoReplaced OPENSSL_CFLAGS with OPENSSL_INCLUDES
illya_dudchenko [Fri, 5 Apr 2019 09:44:29 +0000 (11:44 +0200)]
Replaced OPENSSL_CFLAGS with OPENSSL_INCLUDES

5 years agocomponent: Fix use-after-free
Jakub Adam [Wed, 6 Mar 2019 10:31:13 +0000 (11:31 +0100)]
component: Fix use-after-free

conn_check_prune_socket() was trying to access deleted NiceCandidate
instance. Prune the socket before removing the candidate.

Closes #73

5 years agotest-new-trickle: remove superfluous expression
Jakub Adam [Tue, 12 Feb 2019 14:30:22 +0000 (15:30 +0100)]
test-new-trickle: remove superfluous expression

5 years agotests: enable "trickle-ice" mode
Jakub Adam [Mon, 11 Feb 2019 16:20:01 +0000 (17:20 +0100)]
tests: enable "trickle-ice" mode

Call nice_agent_peer_candidate_gathering_done () where appropriate.

5 years agotest-new-trickle: prevent deadlock in dgram_process()
Jakub Adam [Tue, 12 Feb 2019 13:47:28 +0000 (14:47 +0100)]
test-new-trickle: prevent deadlock in dgram_process()

The STUN thread may be blocked waiting for stun_signal_ptr so signal it
when stopping the thread.

5 years agotests: rename test-dribble to test-trickle
Jakub Adam [Mon, 11 Feb 2019 12:15:39 +0000 (13:15 +0100)]
tests: rename test-dribble to test-trickle

5 years agoagent: trickle ICE mode
Jakub Adam [Wed, 9 Jan 2019 09:29:17 +0000 (10:29 +0100)]
agent: trickle ICE mode

In this mode, activated by setting "ice-trickle" property of a
NiceAgent to TRUE, a component without a successful connectivity check
will wait indefinitely for more remote candidates to come.

nice_agent_peer_candidate_gathering_done() must be called after
receiving the last remote candidate for the component to finally change
its state to NICE_COMPONENT_STATE_FAILED.

5 years agowin32: remove obsolete vs9 build files
Jakub Adam [Mon, 11 Feb 2019 12:16:57 +0000 (13:16 +0100)]
win32: remove obsolete vs9 build files

Windows users should just use Meson for building libnice.

5 years agolibnice.sym: export nice_agent_new_full
Jakub Adam [Wed, 16 Jan 2019 09:50:52 +0000 (10:50 +0100)]
libnice.sym: export nice_agent_new_full

Forgotten to add in 0.1.15 release?

5 years agotest-send-recv: Fix occasional timeouts
Jakub Adam [Tue, 5 Mar 2019 17:05:56 +0000 (18:05 +0100)]
test-send-recv: Fix occasional timeouts

While waiting for write thread to finish sending, keep also receiving so
that any STUN messages from the peer still get processed.

5 years agostun: Fix LibreSSL support
Stefan Strogin [Fri, 15 Feb 2019 18:45:34 +0000 (20:45 +0200)]
stun: Fix LibreSSL support

Closes #71

5 years agoagent: don't print TURN password unless the logging is verbose
Jakub Adam [Mon, 11 Feb 2019 16:22:58 +0000 (17:22 +0100)]
agent: don't print TURN password unless the logging is verbose

Limits accidental leakage of secret information.

5 years agostunbdc: initialize Winsock API when on Windows
Jakub Adam [Mon, 11 Feb 2019 12:26:47 +0000 (13:26 +0100)]
stunbdc: initialize Winsock API when on Windows

5 years agoturn: Allow lifetimes under 60s
Olivier Crête [Tue, 22 Jan 2019 22:57:34 +0000 (17:57 -0500)]
turn: Allow lifetimes under 60s

Don't set a timeout to the very far future if the lifetime sent  by the
server is under 60s. Instead of doing "lifetime - 60", switch to lifetime/2.

5 years agocomponent_io_cb: Avoid potential deadlock
Jakub Adam [Mon, 28 Jan 2019 13:17:18 +0000 (14:17 +0100)]
component_io_cb: Avoid potential deadlock

Don't unref NiceAgent while holding agent mutex. If it's the last
reference, nice_agent_dispose() will try to acquire the mutex again and
deadlock.

5 years agotest-fullmode: Make test non-racy too
Olivier Crête [Mon, 28 Jan 2019 22:18:42 +0000 (17:18 -0500)]
test-fullmode: Make test non-racy too

5 years agotest-drop-invalid: Fix raciness
Olivier Crête [Mon, 28 Jan 2019 22:07:12 +0000 (17:07 -0500)]
test-drop-invalid: Fix raciness

5 years agogitlab-ci: Move docker images to main libnice repo
Olivier Crête [Thu, 24 Jan 2019 00:22:42 +0000 (19:22 -0500)]
gitlab-ci: Move docker images to main libnice repo

5 years agomeson: Require very latest 0.49.1 as older versions break in our CI
Olivier Crête [Thu, 24 Jan 2019 00:12:54 +0000 (19:12 -0500)]
meson: Require very latest 0.49.1 as older versions break in our CI

Also remove workarounds for the older versions.

5 years agogitlab-ci: Work around meson bug for non-POSIX utf-8 characters
Olivier Crête [Fri, 4 Jan 2019 13:56:02 +0000 (08:56 -0500)]
gitlab-ci: Work around meson bug for non-POSIX utf-8 characters

5 years agogitlab-ci: remove username for now because meson craps out on accents
Olivier Crête [Fri, 4 Jan 2019 03:02:32 +0000 (22:02 -0500)]
gitlab-ci: remove username for now because meson craps out on accents

5 years agogitlab ci: Use new CentOS 7 dockerfile based containers everywhere
Olivier Crête [Fri, 4 Jan 2019 00:06:28 +0000 (19:06 -0500)]
gitlab ci: Use new CentOS 7 dockerfile based containers everywhere

5 years agotests: Add Dockerfiles
Olivier Crête [Thu, 3 Jan 2019 23:40:28 +0000 (18:40 -0500)]
tests: Add Dockerfiles

5 years agoturn: Allow alternate server error with no valid credentials
Olivier Crête [Tue, 22 Jan 2019 23:46:55 +0000 (18:46 -0500)]
turn: Allow alternate server error with no valid credentials

coturn doesn't authenticate us before sending us to an alternate server.

5 years agostunagent: Replace more magic numbers with defines
Olivier Crête [Tue, 22 Jan 2019 23:17:39 +0000 (18:17 -0500)]
stunagent: Replace more magic numbers with defines

5 years agoturn: Replace magic numbers with define
Olivier Crête [Tue, 22 Jan 2019 23:15:28 +0000 (18:15 -0500)]
turn: Replace magic numbers with define

5 years agogitlab-ci: Add gtkdoc-check log to build artifacts
Jakub Adam [Wed, 16 Jan 2019 13:51:58 +0000 (14:51 +0100)]
gitlab-ci: Add gtkdoc-check log to build artifacts

5 years agomeson: install .pc file for static gstreamer plugin
Tim-Philipp Müller [Tue, 15 Jan 2019 12:26:57 +0000 (12:26 +0000)]
meson: install .pc file for static gstreamer plugin

5 years agogitlab-ci: Use compiler warning level 2 in Meson build
Jakub Adam [Mon, 7 Jan 2019 09:36:14 +0000 (10:36 +0100)]
gitlab-ci: Use compiler warning level 2 in Meson build

5 years agotests: Fix -Wcast-function-type warnings with GCC 8
Jakub Adam [Mon, 7 Jan 2019 09:31:25 +0000 (10:31 +0100)]
tests: Fix -Wcast-function-type warnings with GCC 8

glib documentation says G_SOURCE_FUNC() macro should be used to suppress
the warning about incompatible function types when the function will be
cast back to the correct type before it is called by the GSource.

5 years agotests: Disable UPnP
Jakub Adam [Mon, 14 Jan 2019 09:24:12 +0000 (10:24 +0100)]
tests: Disable UPnP

An application using more than one NiceAgent instance may crash due to
a race in gUPnP.

Fix is to be released in gUPnP 1.1.2 / 1.0.4:

https://gitlab.gnome.org/GNOME/gupnp/commit/0123e574595e0a547ce26422633df72d63d3d0e0

5 years agomeson: unify exported symbol versions with autotools
Jakub Adam [Mon, 14 Jan 2019 11:44:41 +0000 (12:44 +0100)]
meson: unify exported symbol versions with autotools

libnice.so created by autotools has its symbols bound to the default
'Base' version node, whereas Meson build arbitrarily introduced a
version node named 'libnice'. This breaks tools like dpkg-gensymbols
that track changes in exported symbols through several releases of the
library.

Remove 'libnice' version and revert back to using unspecified version.

5 years agoagent: Fix spelling
Jakub Adam [Mon, 14 Jan 2019 18:03:38 +0000 (19:03 +0100)]
agent: Fix spelling

Errors reported by lintian -EvIL -pedantic.

5 years agoudp-turn: Avoid potential integer overflow
Jakub Adam [Thu, 3 Jan 2019 20:26:41 +0000 (21:26 +0100)]
udp-turn: Avoid potential integer overflow