diff options
author | tron <tron@openttd.org> | 2006-06-17 13:25:22 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-06-17 13:25:22 +0000 |
commit | d9febd1458ca9c53d1d9aa3f0c0e8ffeab3b13a4 (patch) | |
tree | ca5fa6580b40153e0ab9431824669c9c1d10b6e3 | |
parent | 325e460ca9a3c0945337d098f6d1020362eef50f (diff) | |
download | openttd-d9febd1458ca9c53d1d9aa3f0c0e8ffeab3b13a4.tar.xz |
(svn r5297) Check the interface flags if IFF_BROADCAST is set before asking for the broadcast address
-rw-r--r-- | network.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -427,7 +427,9 @@ static void NetworkFindIPs(void) struct ifreq r; strncpy(r.ifr_name, req->ifr_name, lengthof(r.ifr_name)); - if (ioctl(sock, SIOCGIFBRDADDR, &r) != -1) { + if (ioctl(sock, SIOCGIFFLAGS, &r) != -1 && + r.ifr_flags & IFF_BROADCAST && + ioctl(sock, SIOCGIFBRDADDR, &r) != -1) { _broadcast_list[i++] = ((struct sockaddr_in*)&r.ifr_broadaddr)->sin_addr.s_addr; } |