[OpenWrt-Devel] [PATCH] coova-chilli: fix compilation error with --enable-redir
Xabier Oneca -- xOneca
xoneca at gmail.com
Fri Sep 28 08:05:09 EDT 2018
musl lacks `allocated` member on `struct re_pattern_buffer`
(https://fossies.org/dox/musl-1.1.20/structre__pattern__buffer.html).
Patch inspired by drkhosla @github.com/coova/coova-chilli issue #200
(https://github.com/coova/coova-chilli/issues/200#issuecomment-253497070)
Signed-off-by: Xabier Oneca <xoneca at gmail.com>
---
.../300-fix-compile-with-enable-redirurl.patch | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644
net/coova-chilli/patches/300-fix-compile-with-enable-redirurl.patch
diff --git a/net/coova-chilli/patches/300-fix-compile-with-enable-redirurl.patch
b/net/coova-chilli/patches/300-fix-compile-with-enable-redirurl.patch
new file mode 100644
index 0000000..b7ae041
--- /dev/null
+++ b/net/coova-chilli/patches/300-fix-compile-with-enable-redirurl.patch
@@ -0,0 +1,25 @@
+--- a/src/options.c
++++ b/src/options.c
+@@ -377,7 +377,7 @@ int options_fromfd(int fd, bstring bt) {
+
+ #ifdef ENABLE_CHILLIREDIR
+ for (i = 0; i < MAX_REGEX_PASS_THROUGHS; i++) {
+-#if defined (__FreeBSD__) || defined (__APPLE__) || defined
(__OpenBSD__) || defined (__NetBSD__)
++#if defined (__linux__) || defined (__FreeBSD__) || defined
(__APPLE__) || defined (__OpenBSD__) || defined (__NetBSD__)
+ regfree(&_options.regex_pass_throughs[i].re_host);
+ regfree(&_options.regex_pass_throughs[i].re_path);
+ regfree(&_options.regex_pass_throughs[i].re_qs);
+--- a/src/main-redir.c
++++ b/src/main-redir.c
+@@ -508,11 +508,6 @@ check_regex(regex_t *re, char *regex, ch
+ syslog(LOG_DEBUG, "Checking %s =~ %s", s, regex);
+ #endif
+
+-#if defined (__FreeBSD__) || defined (__APPLE__) || defined
(__OpenBSD__) || defined (__NetBSD__)
+- if (!re->re_g)
+-#else
+- if (!re->allocated)
+-#endif
+ {
+ if ((ret = regcomp(re, regex, REG_EXTENDED | REG_NOSUB)) != 0) {
+ char error[512];
--
1.9.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-coova-chilli-fix-compilation-error-with-enable-redir.patch
Type: text/x-patch
Size: 2108 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20180928/b7734b2f/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list