From 6b774bb235ff81122303601538de053df2c1459d Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 18 Nov 2023 22:30:35 +0900 Subject: [PATCH] added check for some networking headers --- Makefile.in | 4 ++-- configure | 9 +++++++++ configure.ac | 2 +- lib/hio-cfg.h.in | 3 +++ lib/sck.c | 13 +++++++++---- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index d26b21a..bf0c2eb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -163,8 +163,8 @@ am__DIST_COMMON = $(srcdir)/Dockerfile.in $(srcdir)/Makefile.in \ $(top_srcdir)/ac/install-sh $(top_srcdir)/ac/ltmain.sh \ $(top_srcdir)/ac/missing $(top_srcdir)/ac/tap-driver.sh \ $(top_srcdir)/pkgs/hio.spec.in ac/ar-lib ac/compile \ - ac/config.guess ac/config.sub ac/install-sh ac/ltmain.sh \ - ac/missing + ac/config.guess ac/config.sub ac/depcomp ac/install-sh \ + ac/ltmain.sh ac/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) diff --git a/configure b/configure index 9d28440..d2204b4 100755 --- a/configure +++ b/configure @@ -15024,6 +15024,15 @@ if test "x$ac_cv_header_net_if_dl_h" = xyes then : printf "%s\n" "#define HAVE_NET_IF_DL_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/if_ether.h" "ac_cv_header_netinet_if_ether_h" " + #include + #include +" +if test "x$ac_cv_header_netinet_if_ether_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IF_ETHER_H 1" >>confdefs.h + fi ac_fn_c_check_header_compile "$LINENO" "netpacket/packet.h" "ac_cv_header_netpacket_packet_h" " #include diff --git a/configure.ac b/configure.ac index 84e0a7b..15483ca 100644 --- a/configure.ac +++ b/configure.ac @@ -117,7 +117,7 @@ AC_CHECK_HEADERS([sys/resource.h sys/wait.h sys/syscall.h sys/ioctl.h]) AC_CHECK_HEADERS([sys/sendfile.h sys/epoll.h sys/event.h sys/poll.h]) AC_CHECK_HEADERS([sys/sysctl.h sys/socket.h sys/sockio.h sys/un.h]) AC_CHECK_HEADERS([ifaddrs.h tiuser.h linux/netfilter_ipv4.h netinet/in.h netinet/sctp.h]) -AC_CHECK_HEADERS([net/if.h net/if_dl.h netpacket/packet.h net/bpf.h], [], [], [ +AC_CHECK_HEADERS([net/if.h net/if_dl.h netinet/if_ether.h netpacket/packet.h net/bpf.h], [], [], [ #include #include ]) AC_CHECK_HEADERS([sys/stropts.h sys/macstat.h linux/ethtool.h linux/sockios.h]) diff --git a/lib/hio-cfg.h.in b/lib/hio-cfg.h.in index 7680a70..8d52e08 100644 --- a/lib/hio-cfg.h.in +++ b/lib/hio-cfg.h.in @@ -208,6 +208,9 @@ /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IF_ETHER_H + /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H diff --git a/lib/sck.c b/lib/sck.c index 86bc9a4..894aa2c 100644 --- a/lib/sck.c +++ b/lib/sck.c @@ -32,10 +32,15 @@ #include #include /* strerror */ -#include -#include -#include -#include +#if defined(HAVE_NETINET_IN_H) +# include +#endif +#if defined(HAVE_NET_IF_H) +# include +#endif +#if defined(HAVE_NETINET_IF_ETHER_H) +# include +#endif #if defined(HAVE_NETINET_SCTP_H) # include