1. 04 Jul, 2019 20 commits
    • Fabrice Bellet's avatar
      conncheck: define a property for a final idle timeout · 0512ecaa
      Fabrice Bellet authored
      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
      0512ecaa
    • Fabrice Bellet's avatar
      conncheck: fix pair priorities uniqueness · 2118cbae
      Fabrice Bellet authored
      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).
      2118cbae
    • Fabrice Bellet's avatar
      conncheck: create the valid pair on early tcp stun requests · 628fc393
      Fabrice Bellet authored
      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().
      628fc393
    • Fabrice Bellet's avatar
      agent: discard sockptr on updated remote candidates · d2254766
      Fabrice Bellet authored
      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.
      d2254766
    • Fabrice Bellet's avatar
      component: remove socket also from remote candidates · 6303ed6f
      Fabrice Bellet authored
      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
      6303ed6f
    • Fabrice Bellet's avatar
      debug: fix verbose debug enable · b3c347bd
      Fabrice Bellet authored
      b3c347bd
    • Fabrice Bellet's avatar
      d7bf3d25
    • Fabrice Bellet's avatar
      conncheck: test incoming checks on candidate base address · e6a19418
      Fabrice Bellet authored
      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.
      e6a19418
    • Fabrice Bellet's avatar
      f482a02c
    • Fabrice Bellet's avatar
      conncheck: increase dumped information in debug · a383faa4
      Fabrice Bellet authored
      In complement to the conncheck list, we dump the pair transport type,
      the socket type, and the incoming checks list.
      a383faa4
    • Fabrice Bellet's avatar
      3e25df77
    • Fabrice Bellet's avatar
      agent: more debug when remote credential are received · 43f3d70e
      Fabrice Bellet authored
      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.
      43f3d70e
    • Fabrice Bellet's avatar
      agent: signal when a selected pair foundation is updated · c1fb6f28
      Fabrice Bellet authored
      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()
      c1fb6f28
    • Fabrice Bellet's avatar
      nicesrc: fix a leak spotted by asan · b3638c63
      Fabrice Bellet authored
      b3638c63
    • Fabrice Bellet's avatar
    • Fabrice Bellet's avatar
      Revert "conncheck: Don't lookup prflx pair for UDP candidates" · 07d3caa5
      Fabrice Bellet authored
      This reverts commit ca47519f.
      07d3caa5
    • Fabrice Bellet's avatar
      component: Fix use-after-free and resolve regression · 71a8a9e2
      Fabrice Bellet authored
      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 541801d4 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
      71a8a9e2
    • Fabrice Bellet's avatar
      agent: fix a memory leak · cceaffeb
      Fabrice Bellet authored
      cceaffeb
    • Fabrice Bellet's avatar
      agent: keep a ref on the agent while removal of TURN refreshes · 6f0c7e82
      Fabrice Bellet authored
      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
      6f0c7e82
    • Fabrice Bellet's avatar
      discovery: fix an use-after-free in SFB user credentials · 8e5809b7
      Fabrice Bellet authored
      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.
      8e5809b7
  2. 03 Jul, 2019 1 commit
  3. 02 Jul, 2019 1 commit
    • Olivier Crête's avatar
      agent: add nice_agent_get_sockets API · 875a23a7
      Olivier Crête authored
      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
      875a23a7
  4. 27 Jun, 2019 8 commits
    • Fabrice Bellet's avatar
      b9985474
    • Stefan Becker's avatar
      build: add default ignore network interface prefix · 099ff65c
      Stefan Becker authored
      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=[] ...
      099ff65c
    • Stefan Becker's avatar
      configure: support --without-ignored-network-interface-prefix · 056de4ae
      Stefan Becker authored
      This fixes commit b4abda09
      
      --without-XXX sets $withval to "no", hence we must check for this special
      value instead of ignoring network interfaces that start with "no".
      056de4ae
    • Stefan Becker's avatar
      build: make prefix option accept a list of strings · d4bc4fa3
      Stefan Becker authored
      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 ...
      d4bc4fa3
    • Stefan Becker's avatar
      interfaces: allow list of ignored prefixes · 7b4b46f9
      Stefan Becker authored
      Improve on commit b4abda09
      
      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.
      7b4b46f9
    • Stefan Becker's avatar
      interfaces: ignore non-running interfaces · 0245565e
      Stefan Becker authored
      Check for IFF_UP and IFF_RUNNING flags on the interface.
      0245565e
    • Stefan Becker's avatar
      tests: ignore trickle executables · ac4149c3
      Stefan Becker authored
      This fixes commit 9afd0c8b
      ac4149c3
    • Stefan Becker's avatar
      interfaces: detect IPv6 ULA & link-local addresses · e920a995
      Stefan Becker authored
      Update nice_interfaces_is_private_ip() to handle IPv6 too:
      
      - unique local address block: fc00::/7
      - link-local address block:   fe80::/10
      e920a995
  5. 26 Jun, 2019 2 commits
  6. 05 Jun, 2019 2 commits
  7. 29 May, 2019 1 commit
  8. 20 May, 2019 1 commit
  9. 10 May, 2019 1 commit
  10. 09 May, 2019 3 commits