[svn-commits] tilghman: branch 1.4 r101772 - in /branches/1.4: ./ include/asterisk/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Feb 1 09:55:59 CST 2008


Author: tilghman
Date: Fri Feb  1 09:55:58 2008
New Revision: 101772

URL: http://svn.digium.com/view/asterisk?view=rev&rev=101772
Log:
Compatibility fix for OpenWRT (reported by Brian Capouch via the mailing list)

Modified:
    branches/1.4/configure
    branches/1.4/configure.ac
    branches/1.4/include/asterisk/autoconfig.h.in
    branches/1.4/main/acl.c

Modified: branches/1.4/configure.ac
URL: http://svn.digium.com/view/asterisk/branches/1.4/configure.ac?view=diff&rev=101772&r1=101771&r2=101772
==============================================================================
--- branches/1.4/configure.ac (original)
+++ branches/1.4/configure.ac Fri Feb  1 09:55:58 2008
@@ -403,6 +403,8 @@
 if test "x${host_os}" = "xlinux-gnu" ; then
   AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
 fi
+
+AST_EXT_LIB_CHECK([GETIFADDRS], [c], [getifaddrs], [ifaddrs.h])
 
 GSM_INTERNAL="yes"
 AC_SUBST(GSM_INTERNAL)

Modified: branches/1.4/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/autoconfig.h.in?view=diff&rev=101772&r1=101771&r2=101772
==============================================================================
--- branches/1.4/include/asterisk/autoconfig.h.in (original)
+++ branches/1.4/include/asterisk/autoconfig.h.in Fri Feb  1 09:55:58 2008
@@ -122,6 +122,9 @@
 
 /* Define to 1 if you have the `gethostname' function. */
 #undef HAVE_GETHOSTNAME
+
+/* Define to indicate the ${GETIFADDRS_DESCRIP} library */
+#undef HAVE_GETIFADDRS
 
 /* Define to 1 if you have the `getloadavg' function. */
 #undef HAVE_GETLOADAVG

Modified: branches/1.4/main/acl.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/acl.c?view=diff&rev=101772&r1=101771&r2=101772
==============================================================================
--- branches/1.4/main/acl.c (original)
+++ branches/1.4/main/acl.c Fri Feb  1 09:55:58 2008
@@ -51,7 +51,7 @@
 #if defined(SOLARIS)
 #include <sys/sockio.h>
 #include <net/if.h>
-#else
+#elif defined(HAVE_GETIFADDRS)
 #include <ifaddrs.h>
 #endif
 
@@ -88,6 +88,12 @@
 	struct sockaddr_in ifru_addr;
 };
 
+#if (!defined(SOLARIS) && !defined(HAVE_GETIFADDRS))
+static int get_local_address(struct in_addr *ourip)
+{
+	return -1;
+}
+#else
 static void score_address(const struct sockaddr_in *sin, struct in_addr *best_addr, int *best_score)
 {
 	const char *address;
@@ -241,6 +247,8 @@
 		memcpy(ourip, &best_addr, sizeof(*ourip));
 	return res;
 }
+#endif /* HAVE_GETIFADDRS */
+
 /* Free HA structure */
 void ast_free_ha(struct ast_ha *ha)
 {




More information about the svn-commits mailing list