diff --git a/CMakeLists-implied-options.txt b/CMakeLists-implied-options.txt index b0e39341c0..d86770e9d9 100644 --- a/CMakeLists-implied-options.txt +++ b/CMakeLists-implied-options.txt @@ -352,6 +352,11 @@ if (LWS_IPV6) set(LWS_WITH_IPV6 1) endif() +if (LWS_HAVE_LINUX_IPV6_H AND NOT LWS_INCLUDE_LINUX_IPV6_H) + message(STATUS "Found linux/ipv6.h but not including it.") + set(LWS_HAVE_LINUX_IPV6_H 0) +endif() + if (LWS_UNIX_SOCK) set(LWS_WITH_UNIX_SOCK 1) endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dc291dd93..74a59739a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,6 +153,7 @@ option(LWS_WITH_HTTP2 "Compile with server support for HTTP/2" ON) option(LWS_WITH_LWSWS "Libwebsockets Webserver" OFF) option(LWS_WITH_CGI "Include CGI (spawn process with network-connected stdin/out/err) APIs" OFF) option(LWS_IPV6 "Compile with support for ipv6" OFF) +option(LWS_INCLUDE_LINUX_IPV6_H "Include Linux ipv6.h header if found" ON) option(LWS_UNIX_SOCK "Compile with support for UNIX domain socket if OS supports it" ON) option(LWS_WITH_PLUGINS "Support plugins for protocols and extensions (implies LWS_WITH_PLUGINS_API)" OFF) option(LWS_WITH_PLUGINS_BUILTIN "Build the plugin protocols directly into lws library" OFF) diff --git a/lib/roles/h1/ops-h1.c b/lib/roles/h1/ops-h1.c index 2cd95eefb9..11840a8190 100644 --- a/lib/roles/h1/ops-h1.c +++ b/lib/roles/h1/ops-h1.c @@ -974,8 +974,10 @@ static const char * const http_methods[] = { int _lws_is_http_method(const char *method) { + int n; + if (method) - for (int n = 0; n < (int)LWS_ARRAY_SIZE(http_methods); n++) + for (n = 0; n < (int)LWS_ARRAY_SIZE(http_methods); n++) if (!strcmp(method, http_methods[n])) return 1; diff --git a/lib/roles/netlink/ops-netlink.c b/lib/roles/netlink/ops-netlink.c index 7108dc2f76..d81f13663f 100644 --- a/lib/roles/netlink/ops-netlink.c +++ b/lib/roles/netlink/ops-netlink.c @@ -35,6 +35,7 @@ #include #include #include +#include //#define lwsl_netlink lwsl_notice #define lwsl_cx_netlink lwsl_cx_info @@ -207,10 +208,12 @@ rops_handle_POLLIN_netlink(struct lws_context_per_thread *pt, struct lws *wsi, lws_sa46_write_numeric_address(&robj.dest, buf, sizeof(buf)); lwsl_cx_netlink_debug(cx, "IFA_ADDRESS: %s/%d", buf, robj.dest_len); break; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) case IFA_FLAGS: lwsl_cx_netlink_debug(cx, "IFA_FLAGS: 0x%x (not handled)", *(unsigned int*)RTA_DATA(ra)); break; +#endif case IFA_BROADCAST: lwsl_cx_netlink_debug(cx, "IFA_BROADCAST (not handled)"); break; diff --git a/plugins/deaddrop/protocol_lws_deaddrop.c b/plugins/deaddrop/protocol_lws_deaddrop.c index 1671662ba3..fb80f9ecc3 100644 --- a/plugins/deaddrop/protocol_lws_deaddrop.c +++ b/plugins/deaddrop/protocol_lws_deaddrop.c @@ -419,8 +419,9 @@ handler_server_protocol_init(struct lws *wsi, void *in) * lws event loop on our vhost, so we can be told about * external changes to the dir contents */ - vhd->inotify_fd = inotify_init1(IN_NONBLOCK); + vhd->inotify_fd = inotify_init(); if (vhd->inotify_fd >= 0) { + fcntl(vhd->inotify_fd, F_SETFL, O_NONBLOCK); if (inotify_add_watch(vhd->inotify_fd, vhd->upload_dir, IN_CLOSE_WRITE | IN_DELETE | IN_MOVED_FROM | IN_MOVED_TO) >= 0)