From 34c48a15ca9de6a2dd4ec9fdca40d3e279918e55 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 9 Aug 2023 16:43:24 +0200 Subject: [PATCH] configure: remove check for if_nametoindex if_nametoindex is present in both POSIX and Windows (since Vista) + print the error message as error_msg - debug_msg there was rather a mistake --- configure.ac | 17 ----------------- src/rtp/net_udp.c | 6 +----- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index d52127f9c..5003e241d 100644 --- a/configure.ac +++ b/configure.ac @@ -299,23 +299,6 @@ AC_DEFUN([DEFINE_CUDA], [ ]) AC_SUBST(DLL_LIBS) -if test $system = Windows -then - AC_MSG_CHECKING([if_nametoindex]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]], [[ - if_nametoindex("eth");]] - )], HAVE_IF_NAMETOINDEX=yes, HAVE_IF_NAMETOINDEX=no) - AC_MSG_RESULT([$HAVE_IF_NAMETOINDEX]) - if test $HAVE_IF_NAMETOINDEX = yes; then - AC_DEFINE([HAVE_IF_TONAMEINDEX], 1, [Function if_nametoindex is present.]) - fi -else - AC_CHECK_FUNCS(if_nametoindex) -fi - AC_CHECK_FUNCS(usleep) AC_CHECK_FUNCS(strtok_r) AC_CHECK_FUNCS(timespec_get) diff --git a/src/rtp/net_udp.c b/src/rtp/net_udp.c index 810b4d650..5fb245103 100644 --- a/src/rtp/net_udp.c +++ b/src/rtp/net_udp.c @@ -810,14 +810,10 @@ socket_udp *udp_init_if(const char *addr, const char *iface, uint16_t rx_port, goto error; } if (iface != NULL) { -#ifdef HAVE_IF_NAMETOINDEX if ((s->ifindex = if_nametoindex(iface)) == 0) { - debug_msg("Illegal interface specification\n"); + error_msg("Illegal interface specification\n"); goto error; } -#else - log_msg(LOG_LEVEL_ERROR, "Cannot set interface name, if_nametoindex not supported.\n"); -#endif } else { s->ifindex = 0; }