summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-17 19:11:02 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-17 19:11:02 +0000
commit472eb3bd0d8598c2230fc1d8959fcc7e0a450cac (patch)
treedd9a422ebf6dd495458b780678173ff3f65339ed /src
parentc8d3ca81535c90da0b9d903b0976715f5fc5198b (diff)
downloadhercules-472eb3bd0d8598c2230fc1d8959fcc7e0a450cac.tar.gz
hercules-472eb3bd0d8598c2230fc1d8959fcc7e0a450cac.tar.bz2
hercules-472eb3bd0d8598c2230fc1d8959fcc7e0a450cac.tar.xz
hercules-472eb3bd0d8598c2230fc1d8959fcc7e0a450cac.zip
Reverting r12212. As expected, Linux is incompatible.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12213 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/common/socket.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index 58c7b6c5e..2dd860715 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -1153,6 +1153,8 @@ int socket_getips(uint32* ips, int max)
fd = sSocket(AF_INET, SOCK_STREAM, 0);
+ memset(buf, 0x00, sizeof(buf));
+
// The ioctl call will fail with Invalid Argument if there are more
// interfaces than will fit in the buffer
ic.ifc_len = sizeof(buf);
@@ -1173,7 +1175,11 @@ int socket_getips(uint32* ips, int max)
if( ad != INADDR_LOOPBACK && ad != INADDR_ANY )
ips[num++] = (uint32)ad;
}
+ #if (defined(BSD) && BSD >= 199103) || defined(_AIX) || defined(__APPLE__)
pos += ir->ifr_addr.sa_len + sizeof(ir->ifr_name);
+ #else// not AIX or APPLE
+ pos += sizeof(struct ifreq);
+ #endif//not AIX or APPLE
}
}
sClose(fd);