Commit 3174bb71 authored by Thomas Markwalder's avatar Thomas Markwalder

[v4_1_esv] Fixed interface device naming for DLPI under Solaris 11

    Merges in rt37954.
parent d73e864c
......@@ -180,6 +180,12 @@ by Eric Young (eay@cryptsoft.com).
- Corrected minor Coverity issues.
[ISC-Bugs #35144]
- 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.1-ESV-R12b1
- None
......
......@@ -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);
......@@ -791,9 +797,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) {
......
......@@ -6624,7 +6624,31 @@ CFLAGS="$CFLAGS $STD_CWARNINGS"
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
......
......@@ -630,7 +630,13 @@ CFLAGS="$CFLAGS $STD_CWARNINGS"
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
......
......@@ -151,6 +151,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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment