summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gitlab-ci: Add MSVC buildsmsvc-buildOlivier Crête2019-08-051-0/+37
| | | | | | Uses a wrap file to download a prebuilt OpenSSL from our git as a subproject. Builds for both amd64 & x86
* tests: Don't use GSubprocessLauncherOlivier Crete2019-08-051-10/+5
| | | | It crashes on Windows
* test-fullmode-with-stun: Use portable g_usleep() for MSVCOlivier Crête2019-08-021-1/+1
|
* meson.build: Simplify shell based test checksOlivier Crête2019-08-021-8/+6
|
* meson: Add non-pkgconfig test for OpenSSLOlivier Crête2019-08-021-11/+44
| | | | | This makes it work with Windows MSVC builds of OpenSSL which don't include a pkg-config file.
* CI: add basic msys2 buildJordan Petridis2019-08-022-0/+38
| | | | | | | | | For now it uses the gstreamer docker image and shared runner, based on windows server 1607. The runner will migrate to windows 1807 soonish hopefully. This commit also adds a glib wrap file needed to build libnice.
* tests: Port test-fullmode-with-stun wrapper to COlivier Crête2019-08-022-5/+68
| | | | Shell scripts don't work well on Windows and Python doesn't work with valgrind.
* stund: Add win32 supportOlivier Crête2019-08-021-11/+19
|
* conncheck: fix a wrong transport value in debugFabrice Bellet2019-08-021-2/+4
|
* dockerfiles: Add buildah format export to make gitlab happyOlivier Crête2019-08-012-0/+2
|
* tests: Pass GST env with valgrind tooOlivier Crête2019-07-311-4/+2
|
* libnice.supp: Add RHEL 7 suppressionsOlivier Crête2019-07-311-0/+51
|
* gitlab-ci: Add valgrind autotools test tooOlivier Crête2019-07-311-0/+7
|
* dockerfiles: Add valgrind to docker filesOlivier Crête2019-07-312-2/+16
|
* gitlab-ci: Use extends to reduce size of scriptOlivier Crête2019-07-311-11/+1
|
* gitlab-ci: Add valgrind meson testOlivier Crête2019-07-311-0/+19
|
* meson: Add valgrind setupOlivier Crête2019-07-311-0/+10
|
* libnice.supp: Add GStreamer suppressionsOlivier Crête2019-07-311-0/+17
|
* test-gstreamer: fix buffer leakOlivier Crête2019-07-311-0/+4
|
* conncheck: Drop valid STUN for which we can't find a requestOlivier Crête2019-07-313-2/+10
| | | | | It's most likely caused by a retransmission received after the initial request already had a reply.
* test-tcp: Only free passive socket after childOlivier Crête2019-07-311-2/+1
| | | | The child now calls into the parent..
* test-turn: Initialize variable earlier to avoid raceOlivier Crête2019-07-311-3/+4
|
* test-udp-turn-fragmentation: Avoid leaking test socketOlivier Crête2019-07-311-4/+8
|
* test-different-number-streams: Avoid leaking NiceAddressOlivier Crête2019-07-311-5/+5
|
* conncheck: ignore selected pairs for nomination that failedFabrice Bellet2019-07-301-2/+4
| | | | | | | | | | | | When evaluating the stopping criterion, failed pairs from other streams having the "use_candidate_on_next_check" flag set should be ignored. This should normally not happen, because a pair selected for nomination has no reason to fail when being rechecked, since it previously worked... but it may happen with Skype for Business, when libnice selects a tcp pair for component 1, the peer seems to have no interest in the second component and lets it fail in the middle of the conncheck.
* conncheck: make the stopping criterion a bit more clearFabrice Bellet2019-07-301-52/+63
| | | | | This patch doesn't change the logic of the selection of the pair for nomination, it makes the code a bit more simple to read.
* agent: fix a regression when updating foundationsFabrice Bellet2019-07-291-14/+17
| | | | | | | | A previous commit c1fb6f2 introduced a regression in the way the foundation of a selected pair is updated and signaled, when the foundation of its remote candidate changes. The previous comparison was made on *always* identical strings, so the update of the selected pair was *never* signaled.
* conncheck: update a misleading debug statementFabrice Bellet2019-07-291-2/+1
| | | | | | We may not have received remote candidates yet, but we may have discovered remote candidates from the early incoming checks. Only having stream credentials is required to react to these checks.
* udp-bsd: Use sockaddr_storage union to ensure big enough socketOlivier Crête2019-07-281-5/+8
| | | | | The IPv6 struct sockaddr variant is bigger than the IPv4 one, so use the storage struct to ensure that the size is big enough.
* discovery: Don't start STUN/TURN disco on errorneous socketJakub Adam2019-07-221-15/+14
| | | | | | | | | | | | 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.
* udp-bsd: log source and destination addresses on GSocket send errorJakub Adam2019-07-191-4/+24
|
* agent: fix server-reflexive candidates with oc2007r2Fabrice Bellet2019-07-191-2/+35
| | | | | | | | | | | | | | | | | | | | 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
* conncheck: avoid transport association mismatchFabrice Bellet2019-07-121-2/+35
| | | | | | | | | | | | | 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).
* interfaces: ignore only interfaces we really want toJakub Adam2019-07-121-0/+1
| | | | | Once an interface got ignored, ALL interfaces coming after it were dropped too.
* candidate: replace uint8_t -> guint8Jakub Adam2019-07-121-2/+2
| | | Fixes MSVC build.
* debug: fix verbose modeJakub Adam2019-07-121-6/+4
| | | | Since g_parse_debug_string() was looking only at the first 4 items in GDebugKey arrays, "libnice-verbose" couldn't get activated.
* examples: fix compiler extra warningsFabrice Bellet2019-07-112-2/+2
|
* agent: fix condition for turn-tcp discovery creationFabrice Bellet2019-07-111-6/+3
| | | | | We support turn-tcp in oc2007 compatibility only and when the host candidate transport is compatible, ie when reliable_tcp is true.
* conncheck: test inbound stun address on the candidate base addressFabrice Bellet2019-07-111-1/+8
| | | | | | | | | | | | | | | | | | | | | | 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.
* conncheck: improve comment on local peer-reflexive selectionFabrice Bellet2019-07-111-4/+10
| | | | | This patch rewrites the comment surrounding this code snippet, to make it clear, that this pair selection is not specific to the tcp transport.
* conncheck: nominate matching pairs across components and streamsFabrice Bellet2019-07-111-57/+207
| | | | | | | | | | | | | | | | | | | | | | 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.
* agent: fix agent reference countFabrice Bellet2019-07-041-0/+1
|
* tests: fix a compiler warningFabrice Bellet2019-07-041-0/+2
|
* tcp-bsd: fix a heap-use-after-freeFabrice Bellet2019-07-041-1/+3
|
* component: don't detach the socket source twiceFabrice Bellet2019-07-041-1/+0
| | | | The source is also detached in socket_source_free()
* conncheck: define a property for a final idle timeoutFabrice Bellet2019-07-043-19/+65
| | | | | | | | | | 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
* conncheck: fix pair priorities uniquenessFabrice Bellet2019-07-043-22/+51
| | | | | | | | | | | | | | | | | | | | | | 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).
* conncheck: create the valid pair on early tcp stun requestsFabrice Bellet2019-07-042-0/+23
| | | | | | 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().
* agent: discard sockptr on updated remote candidatesFabrice Bellet2019-07-041-0/+4
| | | | | | | | 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.
* component: remove socket also from remote candidatesFabrice Bellet2019-07-041-0/+27
| | | | | | | | | | | 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