1
1

Check to ensure that we have struct ifreq.ifr_mtu before we try to use

it, because Solaris although has SIOCFIGMTU, it curiously does not
have ifreq.ifr_mtu.

This commit was SVN r28460.
Этот коммит содержится в:
Jeff Squyres 2013-05-07 13:51:50 +00:00
родитель 4b9b3a81ff
Коммит cad1d920b2
2 изменённых файлов: 16 добавлений и 6 удалений

Просмотреть файл

@ -20,6 +20,9 @@ AC_DEFUN([MCA_opal_if_posix_ipv4_COMPILE_MODE], [
AC_DEFUN([MCA_opal_if_posix_ipv4_CONFIG], [
AC_CONFIG_FILES([opal/mca/if/posix_ipv4/Makefile])
OPAL_VAR_SCOPE_PUSH([opal_if_posix_ipv4_happy])
opal_if_posix_ipv4_happy=no
AC_REQUIRE([OPAL_CHECK_OS_FLAVORS])
# If we found struct sockaddr and we're NOT on most of the BSDs,
@ -32,9 +35,16 @@ AC_DEFUN([MCA_opal_if_posix_ipv4_CONFIG], [
AC_MSG_CHECKING([not NetBSD, FreeBSD, OpenBSD, or DragonFly])
AS_IF([test "$opal_found_netbsd" = "no" -a "$opal_found_freebsd" = "no" -a "$opal_found_openbsd" = "no" -a "$opal_found_dragonfly" = "no"],
[AC_MSG_RESULT([yes])
$1],
[AC_MSG_RESULT([no])
$2])],
[AC_MSG_RESULT([no (cached)])
$2])
opal_if_posix_ipv4_happy=yes],
[AC_MSG_RESULT([no])]
)],
[AC_MSG_RESULT([no (cached)])]
)
AS_IF([test "$opal_if_posix_ipv4_happy" = "yes"],
[AC_CHECK_MEMBERS([struct ifreq.ifr_mtu], [], [],
[[#include <net/if.h>]])
])
AS_IF([test "$opal_if_posix_ipv4_happy" = "yes"], [$1], [$2]);
])dnl

Просмотреть файл

@ -270,7 +270,7 @@ static int if_posix_open(void)
memcpy(intf->if_mac, ifr->ifr_hwaddr.sa_data, 6);
#endif
#ifdef SIOCGIFMTU
#if defined(SIOCGIFMTU) && defined(HAVE_STRUCT_IFREQ_IFR_MTU)
/* get the MTU */
if (ioctl(sd, SIOCGIFMTU, ifr) < 0) {
opal_output(0, "btl_usnic_opal_ifinit: ioctl(SIOCGIFMTU) failed with errno=%d", errno);