diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/core/host.cpp | 9 | ||||
-rw-r--r-- | src/network/core/os_abstraction.h | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index ee9fcfe8f..d622e2e8c 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -30,9 +30,9 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // PS { } -#elif defined(BEOS_NET_SERVER) /* doesn't have neither getifaddrs or net/if.h */ +#elif defined(BEOS_NET_SERVER) || defined(__HAIKU__) /* doesn't have neither getifaddrs or net/if.h */ /* Based on Andrew Bachmann's netstat+.c. Big thanks to him! */ -int _netstat(int fd, char **output, int verbose); +extern "C" int _netstat(int fd, char **output, int verbose); int seek_past_header(char **pos, const char *header) { @@ -63,9 +63,9 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // BE char **output = &output_pointer; if (seek_past_header(output, "IP Interfaces:") == B_OK) { for (;;) { - uint32 n, fields, read; + uint32 n; + int fields, read; uint8 i1, i2, i3, i4, j1, j2, j3, j4; - struct in_addr inaddr; uint32 ip; uint32 netmask; @@ -85,7 +85,6 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // BE ((sockaddr_in*)&address)->sin_addr.s_addr = htonl(ip | ~netmask); NetworkAddress addr(address, sizeof(sockaddr)); if (!broadcast->Contains(addr)) *broadcast->Append() = addr; - index++; } if (read < 0) { break; diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h index d9d046139..d0d7204f9 100644 --- a/src/network/core/os_abstraction.h +++ b/src/network/core/os_abstraction.h @@ -155,7 +155,7 @@ static inline void OTTDfreeaddrinfo(struct addrinfo *ai) # include <arpa/inet.h> # include <net/if.h> /* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */ -# if !defined(__sgi__) && !defined(SUNOS) && !defined(__MORPHOS__) && !defined(__BEOS__) && !defined(__INNOTEK_LIBC__) \ +# if !defined(__sgi__) && !defined(SUNOS) && !defined(__MORPHOS__) && !defined(__BEOS__) && !defined(__HAIKU__) && !defined(__INNOTEK_LIBC__) \ && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX) /* If for any reason ifaddrs.h does not exist on your system, comment out * the following two lines and an alternative way will be used to fetch @@ -185,6 +185,10 @@ static inline void OTTDfreeaddrinfo(struct addrinfo *ai) typedef int socklen_t; #endif +#ifdef __HAIKU__ + #define IPV6_V6ONLY 27 +#endif + #if defined(PSP) # include <sys/socket.h> # include <netinet/in.h> |