]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Portability issue on OpenSolaris.
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 10 Dec 2010 16:24:13 +0000 (16:24 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 10 Dec 2010 16:24:13 +0000 (16:24 +0000)
Also detect the required structure element, because OpenSolaris defines
SIOCGIFHWADDR, but without support for IP sockets.

(closes issue #18442)
 Reported by: ranjtech
 Patches:
       20101209__issue18442.diff.txt uploaded by tilghman (license 14)
 Tested by: ranjtech

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@298050 65c4cc65-6c06-0410-ace0-fbb531ad65f3

configure
configure.ac
include/asterisk/autoconfig.h.in
main/netsock.c

index cf3406a3d0a2e33e52ec2aff39673fcd662963b3..74e2a1885d3c61ca3937e48f58870bcd816d003b 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 294429 .
+# From configure.ac Revision: 296533 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.65 for asterisk 1.6.2.
 #
@@ -11864,6 +11864,17 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+fi
+
+ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_ifru.ifru_hwaddr" "ac_cv_member_struct_ifreq_ifr_ifru_ifru_hwaddr" "#include <net/if.h>
+"
+if test "x$ac_cv_member_struct_ifreq_ifr_ifru_ifru_hwaddr" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR 1
+_ACEOF
+
+
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
index 8603f8673318080d6cb59e7e8daa2c526c93e41d..e4b600a74507120a425544ddf40013e1cdff580b 100644 (file)
@@ -393,6 +393,7 @@ AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_CHECK_MEMBERS([struct stat.st_blksize])
 AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid], [], [], [#include <sys/socket.h>])
+AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include <net/if.h>])
 AC_HEADER_TIME
 AC_STRUCT_TM
 AC_C_VOLATILE
index fd22a3f5c0ef4b7f95bda85376e621c4d9b44b86..ae5f9d13699a81392e8d60f704ca356bf07beb3b 100644 (file)
 /* Define to 1 if you have the `strtoq' function. */
 #undef HAVE_STRTOQ
 
+/* Define to 1 if `ifr_ifru.ifru_hwaddr' is a member of `struct ifreq'. */
+#undef HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR
+
 /* Define to 1 if `st_blksize' is a member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_BLKSIZE
 
index e4cfb3bd3b61c71a263b4aa57a22eaeb293e703c..02a143b641de7835e8c13356d3143fc024ef0fc2 100644 (file)
@@ -234,7 +234,7 @@ char *ast_eid_to_str(char *s, int maxlen, struct ast_eid *eid)
 
 void ast_set_default_eid(struct ast_eid *eid)
 {
-#if defined(SIOCGIFHWADDR)
+#if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR)
        int s, x = 0;
        char eid_str[20];
        struct ifreq ifr;