aboutsummaryrefslogtreecommitdiffstats
path: root/main/acl.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-24 16:47:10 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-24 16:47:10 +0000
commitce1bf7ffa230cafe9242634b84551f7c85fe47a9 (patch)
tree45e930a365c876ebb557bac7dcef6268f77c24fc /main/acl.c
parent528da9558169891fbe4cb19e05086b90c7b729a2 (diff)
Merged revisions 100138 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r100138 | qwell | 2008-01-24 10:41:29 -0600 (Thu, 24 Jan 2008) | 6 lines Fix compilation on Solaris. (closes issue #11832) Patches: bug-11832.diff uploaded by snuffy (license 35) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@100139 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/acl.c')
-rw-r--r--main/acl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/main/acl.c b/main/acl.c
index 9944f5076..4a26ec3ce 100644
--- a/main/acl.c
+++ b/main/acl.c
@@ -28,7 +28,6 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/network.h"
-#include <ifaddrs.h>
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__)
#include <fcntl.h>
@@ -37,6 +36,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#if defined(SOLARIS)
#include <sys/sockio.h>
+#include <net/if.h>
+#else
+#include <ifaddrs.h>
#endif
#include "asterisk/acl.h"
@@ -118,8 +120,9 @@ static int get_local_address(struct in_addr *ourip)
int rtnerr;
const struct sockaddr_in *sin;
#endif /* BSD_OR_LINUX */
- struct in_addr best_addr = { 0, };
+ struct in_addr best_addr;
int best_score = -100;
+ memset(&best_addr, 0, sizeof(best_addr));
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__)
rtnerr = getifaddrs(&ifaphead);
@@ -177,7 +180,7 @@ static int get_local_address(struct in_addr *ourip)
for (ifr = (struct lifreq *)buf, x = 0; x < ifn.lifn_count; ifr++, x++) {
sa = (struct sockaddr_in *)&(ifr->lifr_addr);
- score_address(sin, &best_addr, &best_score);
+ score_address(sa, &best_addr, &best_score);
res = 0;
if (best_score == 0)