From a17657c4321dc0770e5431467261eb2bc579f79c Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 26 Apr 2016 18:16:08 +0200 Subject: shim-udp: resolve dst_name using DNS This commits adds the gethostbyname call to resolve the dst_name for a flow allocation using DNS. The DNS server should be specified using the method mandated by the system (e.g. added to /etc/resolv.conf). --- src/ipcpd/shim-udp/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ipcpd/shim-udp/CMakeLists.txt') diff --git a/src/ipcpd/shim-udp/CMakeLists.txt b/src/ipcpd/shim-udp/CMakeLists.txt index 27907880..f730fa3a 100644 --- a/src/ipcpd/shim-udp/CMakeLists.txt +++ b/src/ipcpd/shim-udp/CMakeLists.txt @@ -10,6 +10,21 @@ include_directories(${CURRENT_BINARY_PARENT_DIR}) include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_BINARY_DIR}/include) +# Find library needed for gethostbyname. +include(CheckFunctionExists) +CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) +IF(NOT CMAKE_HAVE_GETHOSTBYNAME) + CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + IF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl) + ELSE (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) + IF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) + SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd) + ENDIF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) + ENDIF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) +ENDIF(NOT CMAKE_HAVE_GETHOSTBYNAME) + SET(IPCP_SHIM_UDP_TARGET ipcpd-shim-udp CACHE STRING "IPCP_SHIM_UDP_TARGET") set(SHIM_UDP_SOURCES -- cgit v1.2.3