[asterisk-commits] qwell: branch 1.4 r100138 - /branches/1.4/main/acl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 24 10:41:30 CST 2008


Author: qwell
Date: Thu Jan 24 10:41:29 2008
New Revision: 100138

URL: http://svn.digium.com/view/asterisk?view=rev&rev=100138
Log:
Fix compilation on Solaris.

Modified:
    branches/1.4/main/acl.c

Change Statistics:
 0 files changed

Modified: branches/1.4/main/acl.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/acl.c?view=diff&rev=100138&r1=100137&r2=100138
==============================================================================
--- branches/1.4/main/acl.c (original)
+++ branches/1.4/main/acl.c Thu Jan 24 10:41:29 2008
@@ -42,7 +42,6 @@
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <sys/ioctl.h>
-#include <ifaddrs.h>
 
 #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__)
 #include <fcntl.h>
@@ -51,6 +50,9 @@
 
 #if defined(SOLARIS)
 #include <sys/sockio.h>
+#include <net/if.h>
+#else
+#include <ifaddrs.h>
 #endif
 
 /* netinet/ip.h may not define the following (See RFCs 791 and 1349) */
@@ -159,8 +161,9 @@
 	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);
@@ -218,7 +221,7 @@
 
 		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)




More information about the asterisk-commits mailing list