summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-05-24 21:31:53 +0200
committerHarald Welte <laforge@gnumonks.org>2011-05-24 21:46:07 +0200
commit4d3a7b124e08a597d5f01fb2a71f3a4677a360a9 (patch)
treef51eb710e8e5fff4dcfcb20926113be72c65a445 /src
parent11c7193ad8ceb4f3898799dc44b700b8b93a59b8 (diff)
socket: Skip ifa's without ifa->ifa_addr
Apparently getifaddrs() returns ifa's without an ifa_addr set.
Diffstat (limited to 'src')
-rw-r--r--src/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index 66907c8c..901b8cdf 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -169,6 +169,8 @@ int osmo_sockaddr_is_local(struct sockaddr *addr, socklen_t addrlen)
}
for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
+ if (!ifa->ifa_addr)
+ continue;
if (sockaddr_equal(ifa->ifa_addr, addr, addrlen))
return 1;
}