Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for ipv6 added at compile time #23

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions configure.seed
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,25 @@ fi

DATE=`date +"%Y-%m-%d"`

# Check for IPv6 support

AC_MSG_CHECKING(for ipv6)
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
#include <sys/socket.h>],
[int sock6 = socket (AF_INET6, SOCK_DGRAM, 0);
u_int8_t is_ip6_enabled = (sock6 >= 0) ? 1 : 0;
close (sock6);
return(!(is_ip6_enabled)); ])],
[ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])

if test "$ac_cv_ipv6_support" = yes; then
AC_DEFINE_UNQUOTED(USE_IPV6, 1, [ipv6 support])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi


if test -d "/usr/include/hiredis"; then
AC_DEFINE_UNQUOTED(HAVE_HIREDIS, 1, [Local hiredis package present])
HIREDIS_INC="`pkg-config --cflags hiredis` -I/usr/include/hiredis"
Expand Down
4 changes: 1 addition & 3 deletions third-party/mongoose/mongoose.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,10 @@ struct mg_connection {

char* http_prefix = NULL; /* ntop */
u_int http_prefix_len = 0; /* ntop */

u_int8_t is_ip6_enabled = 0; /* ntop */

/* ntop */
#if defined(USE_IPV6)
u_int8_t is_ip6_enabled = 1;

static void check_ipv6_enabled() {
const int sock6 = socket (AF_INET6, SOCK_DGRAM, 0);
is_ip6_enabled = (sock6 >= 0) ? 1 : 0;
Expand Down
4 changes: 1 addition & 3 deletions third-party/mongoose/mongoose.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ struct mg_request_info {
} http_headers[64]; // Maximum 64 headers
};

#if !defined(_WIN32)
#define USE_IPV6 1
#endif


// This structure needs to be passed to mg_start(), to let mongoose know
// which callbacks to invoke. For detailed description, see
Expand Down