summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELNOTES6
-rw-r--r--common/dlpi.c14
-rwxr-xr-xconfigure26
-rw-r--r--configure.ac8
-rw-r--r--includes/config.h.in3
5 files changed, 53 insertions, 4 deletions
diff --git a/RELNOTES b/RELNOTES
index 192a08b8..d59461ee 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -236,6 +236,12 @@ by Eric Young (eay@cryptsoft.com).
Please look at doc/DHCPv4-over-DHCPv6 for more details.
[ISC-Bugs #35711]
+- Corrected interface name formation when using DLPI under Solaris 11. As of
+ Solaris 11, ethernet device files are located in "/dev/net". The configure
+ script has been modified to detect this situation and adjust the directory
+ used accordingly.
+ [ISC-Bugs #37954]
+
Changes since 4.3.3b1
- None
diff --git a/common/dlpi.c b/common/dlpi.c
index c34adc39..ff4094ba 100644
--- a/common/dlpi.c
+++ b/common/dlpi.c
@@ -3,7 +3,7 @@
Data Link Provider Interface (DLPI) network interface code. */
/*
- * Copyright (c) 2009-2011,2014 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009-2011,2014,2016 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
@@ -130,7 +130,13 @@ static int strioctl (int fd, int cmd, int timeout, int len, char *dp);
#define DLPI_MAXDLBUF 8192 /* Buffer size */
#define DLPI_MAXDLADDR 1024 /* Max address size */
-#define DLPI_DEVDIR "/dev/" /* Device directory */
+
+/* Device directory */
+#if defined(USE_DEV_NET)
+#define DLPI_DEVDIR "/dev/net/" /* Solaris 11 + */
+#else
+#define DLPI_DEVDIR "/dev/" /* Pre Solaris 11 */
+#endif
static int dlpiopen(const char *ifname);
static int dlpiunit (char *ifname);
@@ -794,9 +800,13 @@ dlpiopen(const char *ifname) {
ep = cp = ifname;
while (*ep)
ep++;
+
+/* Before Solaris 11 we strip off the digit to open the base dev name */
+#if !defined(USE_DEV_NET)
/* And back up to the first digit (unit number) */
while ((*(ep - 1) >= '0' && *(ep - 1) <= '9') || *(ep - 1) == ':')
ep--;
+#endif
/* Copy everything up to the unit number */
while (cp < ep) {
diff --git a/configure b/configure
index 5c980452..77362789 100755
--- a/configure
+++ b/configure
@@ -7170,7 +7170,31 @@ CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"
case "$host" in
*-darwin*)
- CFLAGS="$CFLAGS -D__APPLE_USE_RFC_3542" ;;
+ CFLAGS="$CFLAGS -D__APPLE_USE_RFC_3542";;
+*-solaris*)
+ # As of Solaris 11, ethernet dev files are in /dev/net
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/net" >&5
+$as_echo_n "checking for /dev/net... " >&6; }
+if ${ac_cv_file__dev_net+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "/dev/net"; then
+ ac_cv_file__dev_net=yes
+else
+ ac_cv_file__dev_net=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_net" >&5
+$as_echo "$ac_cv_file__dev_net" >&6; }
+if test "x$ac_cv_file__dev_net" = xyes; then :
+
+$as_echo "#define USE_DEV_NET 1" >>confdefs.h
+
+fi
+
+ ;;
esac
diff --git a/configure.ac b/configure.ac
index 7f05b7d6..ba252d34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -792,7 +792,13 @@ CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"
case "$host" in
*-darwin*)
- CFLAGS="$CFLAGS -D__APPLE_USE_RFC_3542" ;;
+ CFLAGS="$CFLAGS -D__APPLE_USE_RFC_3542";;
+*-solaris*)
+ # As of Solaris 11, ethernet dev files are in /dev/net
+ AC_CHECK_FILE(/dev/net,
+ [AC_DEFINE([USE_DEV_NET], [1],
+ [Define to 1 if ethernet devices are in /dev/net])])
+ ;;
esac
AC_C_FLEXIBLE_ARRAY_MEMBER
diff --git a/includes/config.h.in b/includes/config.h.in
index 403a28f1..02f5dbcf 100644
--- a/includes/config.h.in
+++ b/includes/config.h.in
@@ -169,6 +169,9 @@
/* Define to include server activity tracing support. */
#undef TRACING
+/* Define to 1 if ethernet devices are in /dev/net */
+#undef USE_DEV_NET
+
/* Define to include PIDs in syslog messages. */
#undef USE_LOG_PID