| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Including unused utun devices.
|
|
|
|
| |
Including unused utun devices.
|
|
|
|
|
|
| |
Android now spits other address types too confusing libnice.
This patch is a collaborative work with Tom Gilbert <twcgilbert@gmail.com>
|
| |
|
|
|
|
|
|
| |
We handle interfaces of type AF_INET or AF_INET6 only, so discard other
families before calling sockaddr_to_string() on them, for example
PF_PACKET.
|
|
|
|
|
|
| |
Just put a much larger buffer for this to work.
Fixes #126
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nice_interfaces_get_local_interfaces() was returning the hardware
device names of interfaces that have been seen in the past or could be
connected. It had no relation to the actual interfaces present on the
device. Perhaps this worked back in the XP days, but it is returning
garbage today.
Use GetAdapterAddresses(), and return the adapter friendly names as
the interface names. At the same time, update
nice_interfaces_get_ip_for_interface() to match.
Coincidentally, this also fixes UWP compatibility since GetIfTable and
GetIpAddrTable are not available when targeting UWP. They are only
available for desktop apps:
https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getiftable
https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getipaddrtable
|
| |
|
|
|
|
|
|
|
|
| |
Still prefer ipv4 addresses for backwards-compat. GetBestInterface is
not allowed when targeting UWP, so use GetBestInterfaceEx.
Also add some debug logging to ensure that the function is actually
running correctly.
|
|
|
|
| |
Helps when you forgot to call WSAStartup, for instance.
|
| |
|
|
|
|
|
| |
This makes clang happy
Fixes #100
|
| |
|
|
|
|
|
|
| |
This improves commit bd4b47813844aa0e68e9074b3ac516c383ca8bab
There is a second place where this fix is needed.
|
|
|
|
| |
fix #99
|
|
|
|
|
| |
Once an interface got ignored, ALL interfaces coming after it were
dropped too.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Check for IFF_UP and IFF_RUNNING flags on the interface.
|
|
|
|
|
|
|
| |
Update nice_interfaces_is_private_ip() to handle IPv6 too:
- unique local address block: fc00::/7
- link-local address block: fe80::/10
|
|
|
|
|
|
| |
This fixes commit b4abda09c79e4ce372a3771300abf568c85c7ff5
Copy the implementation to the !HAVE_GETIFADDRS branch too.
|
|
|
|
|
| |
Clone implementation from HAVE_GETIFADDRS branch to !HAVE_GETIFADDRS
branch of nice_interfaces_get_local_ips()
|
|
|
|
| |
Errors reported by lintian -EvIL -pedantic.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some interfaces, like the one managed by libvirtd to provide a network
bridge to locally hosted virtual machines, can be completely ignored
when gathering ICE candidates. The motivation for adding this
possibility is that, ignoring them doesn't remove capabilities, and
improves the overall speed of the connection check method, by reducing
the number of pairs to be tested. This patch adds the possibility to
define such interfaces in the configuration script.
Differential Revision: https://phabricator.freedesktop.org/D948
|
|
|
|
|
| |
sockaddr_to_string() is not needed on UNIX when compiling without
HAVE_GETIFADDRS. This fixes a compiler warning in that case.
|
| |
|
|
|
|
|
| |
This fixes compilation when HAVE_GETIFADDRS is not define. Reported on
the mailing list by Curieux Tres <trescurieux@yahoo.fr>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OpenVPN creates a tun interface having the same IP assigned twice like:
9: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc ...100
link/none
inet 10.222.111.10 peer 10.222.111.9/32 brd 10.222.111.10 scope global tun0
valid_lft forever preferred_lft forever
inet 10.222.111.10/32 brd 10.222.111.10 scope global tun0
valid_lft forever preferred_lft forever
This interface would generate two identical host candidates with the same value
of foundation.
|
| |
|
| |
|
|
|
|
|
|
| |
The old GetIpAddrTable() function only returned IPv4 addresses. In order
to support IPv6 addresses, we need to use GetAdapterAddresses(), which
is available from Windows XP or Server 2003 onwards.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
inet_ntop() drops IPv6 link-local scope IDs on the floor, which means
libnice doesn’t generate any IPv6 candidates for link-local connections,
meaning that it will theoretically fail to negotiate a connection on an
IPv6-only network where the two peers are local.
Fix that by using getnameinfo() to convert sockaddrs to strings, which
preserves the scope ID.
There are no portability concerns — getnameinfo() is POSIX.1-2001, and
isn’t used on Windows (although it is supported, surprisingly).
|
|
|
|
| |
Spotted by Tartan.
|
| |
|
|
|
|
|
|
| |
net/if_arp.h doesn’t exist on OS X, and hence causes cross-compilation
to fail. It doesn’t appear to be needed for any of the functions
currently used in interfaces.c anyway.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Casting from one struct sockaddr type to another breaks C’s strict
aliasing rules (variables of different types cannot alias). Fix this
cleanly by using unions of struct sockaddrs to convert between the
types (i.e. type-punning).
I wish sockaddr didn’t have to be this painful.
See:
http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Optimize-Options.html#Type_002dpunning
|
|
|
|
| |
This helps us when cross compiling libnice for Windows from Linux
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
POSIX (http://www.opengroup.org/onlinepubs/009695399/basedefs/netinet/in.h.html) specifies that sockaddr_in is defined in netinet/in.h. Include the header where this struct is used.
|