Commit 3144e58c authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête
Browse files

interfaces: skip unhandled interface families early

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.
parent c9d0f0f5
Pipeline #243746 passed with stages
in 17 minutes and 10 seconds
...@@ -388,6 +388,10 @@ nice_interfaces_get_local_ips (gboolean include_loopback) ...@@ -388,6 +388,10 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
if (ifa->ifa_addr == NULL) if (ifa->ifa_addr == NULL)
continue; continue;
if (ifa->ifa_addr->sa_family != AF_INET &&
ifa->ifa_addr->sa_family != AF_INET6)
continue;
/* Convert to a string. */ /* Convert to a string. */
addr_string = sockaddr_to_string (ifa->ifa_addr); addr_string = sockaddr_to_string (ifa->ifa_addr);
if (addr_string == NULL) { if (addr_string == NULL) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment