diff options
author | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2010-11-19 01:52:54 +0100 |
---|---|---|
committer | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2010-11-19 01:52:54 +0100 |
commit | 3f669049e77b87cca9168fbd55838bd679b573c4 (patch) | |
tree | b0b8ccc37c7ca4cf383f1ba627329804cc137e51 | |
parent | 749229fa367aed0bb14822a4e2fbbf112d06033e (diff) | |
download | MAC-Telnet-3f669049e77b87cca9168fbd55838bd679b573c4.tar.gz MAC-Telnet-3f669049e77b87cca9168fbd55838bd679b573c4.zip |
Handle network devices without address information correctly.
-rw-r--r-- | devices.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -124,7 +124,7 @@ int getIps(char *name, int nameLen, struct sockaddr_in *ip) { if (int_cursor != NULL) { while (int_cursor != NULL) { dlAddr = (const struct sockaddr_in *) int_cursor->ifa_addr; - if (dlAddr->sin_family == AF_INET) { + if (dlAddr != NULL && dlAddr->sin_family == AF_INET) { memcpy(ip, dlAddr, sizeof(struct sockaddr_in)); strncpy(name, int_cursor->ifa_name, nameLen - 1); name[nameLen - 1] = '\0'; |