mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 05:07:56 +00:00
Prevent segfault for interfaces with no address
This commit is contained in:
parent
b4b256a5ea
commit
780daa3aa4
3
lsif.c
3
lsif.c
@ -191,6 +191,9 @@ doifaddrs(void) {
|
||||
return WHY_perror("getifaddr()");
|
||||
|
||||
for (ifa = ifaddr; ifa != NULL ; ifa = ifa->ifa_next) {
|
||||
if (!ifa->ifa_addr || !ifa->ifa_netmask)
|
||||
continue;
|
||||
|
||||
/* We're only interested in IPv4 addresses */
|
||||
if (ifa->ifa_addr->sa_family != AF_INET) {
|
||||
if (debug & DEBUG_OVERLAYINTERFACES) DEBUGF("Skipping non-AF_INET address on %s", ifa->ifa_name);
|
||||
|
Loading…
Reference in New Issue
Block a user