2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-22 09:57:20 +00:00

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

Merges in rt37954.
This commit is contained in:
Thomas Markwalder 2016-02-23 07:09:17 -05:00
parent e71425b7c4
commit 0f1a34e915
5 changed files with 53 additions and 4 deletions

View File

@ -236,6 +236,12 @@ by Eric Young (eay@cryptsoft.com).
Please look at doc/DHCPv4-over-DHCPv6 for more details. Please look at doc/DHCPv4-over-DHCPv6 for more details.
[ISC-Bugs #35711] [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 Changes since 4.3.3b1
- None - None

View File

@ -3,7 +3,7 @@
Data Link Provider Interface (DLPI) network interface code. */ 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) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium * 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_MAXDLBUF 8192 /* Buffer size */
#define DLPI_MAXDLADDR 1024 /* Max address 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 dlpiopen(const char *ifname);
static int dlpiunit (char *ifname); static int dlpiunit (char *ifname);
@ -794,9 +800,13 @@ dlpiopen(const char *ifname) {
ep = cp = ifname; ep = cp = ifname;
while (*ep) while (*ep)
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) */ /* And back up to the first digit (unit number) */
while ((*(ep - 1) >= '0' && *(ep - 1) <= '9') || *(ep - 1) == ':') while ((*(ep - 1) >= '0' && *(ep - 1) <= '9') || *(ep - 1) == ':')
ep--; ep--;
#endif
/* Copy everything up to the unit number */ /* Copy everything up to the unit number */
while (cp < ep) { while (cp < ep) {

26
configure vendored
View File

@ -7170,7 +7170,31 @@ CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"
case "$host" in case "$host" in
*-darwin*) *-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 esac

View File

@ -792,7 +792,13 @@ CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"
case "$host" in case "$host" in
*-darwin*) *-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 esac
AC_C_FLEXIBLE_ARRAY_MEMBER AC_C_FLEXIBLE_ARRAY_MEMBER

View File

@ -169,6 +169,9 @@
/* Define to include server activity tracing support. */ /* Define to include server activity tracing support. */
#undef TRACING #undef TRACING
/* Define to 1 if ethernet devices are in /dev/net */
#undef USE_DEV_NET
/* Define to include PIDs in syslog messages. */ /* Define to include PIDs in syslog messages. */
#undef USE_LOG_PID #undef USE_LOG_PID