[gssdp] net: Skip all interfaces with non-ip AF
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gssdp] net: Skip all interfaces with non-ip AF
- Date: Tue, 30 Oct 2018 12:15:37 +0000 (UTC)
commit 67f67c2236e7cc40b87c869d023f9db32c0caf60
Author: Jens Georg <mail jensge org>
Date: Tue Oct 30 12:55:15 2018 +0100
net: Skip all interfaces with non-ip AF
We handle AF_INET / AF_INET6 only anyway.
libgssdp/gssdp-net-posix.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/libgssdp/gssdp-net-posix.c b/libgssdp/gssdp-net-posix.c
index dd5859e..f57b65c 100644
--- a/libgssdp/gssdp-net-posix.c
+++ b/libgssdp/gssdp-net-posix.c
@@ -131,6 +131,7 @@ gssdp_net_get_host_ip (GSSDPNetworkDevice *device)
{
struct ifaddrs *ifa_list, *ifa;
GList *up_ifaces, *ifaceptr;
+ sa_family_t family = AF_UNSPEC;
up_ifaces = NULL;
@@ -145,6 +146,11 @@ gssdp_net_get_host_ip (GSSDPNetworkDevice *device)
if (ifa->ifa_addr == NULL)
continue;
+ family = ifa->ifa_addr->sa_family;
+ if (family != AF_INET && family != AF_INET6) {
+ continue;
+ }
+
if (device->iface_name &&
!g_str_equal (device->iface_name, ifa->ifa_name))
continue;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]