From: Steven Barth Date: Sun, 14 Sep 2008 11:12:39 +0000 (+0000) Subject: Make Boa IPv6-ready. Patch by Alina Friedrichsen. Thanks a lot. X-Git-Tag: 0.9.0~1312 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=5fff612e0a051d524b5fd9d7d4a27bba1c2ea286;hp=e491e675880f338c68214ce8f6ec6584d21623d9 Make Boa IPv6-ready. Patch by Alina Friedrichsen. Thanks a lot. --- diff --git a/libs/sgi-webuci/Makefile b/libs/sgi-webuci/Makefile index c7f70eb5c..cea6c748a 100644 --- a/libs/sgi-webuci/Makefile +++ b/libs/sgi-webuci/Makefile @@ -36,7 +36,7 @@ $(BOA_DIR)/.configured: $(BOA_DIR)/.patched touch $@ boa-compile: $(BOA_DIR)/.configured - $(MAKE) -C $(BOA_DIR)/src CC=$(CC) CFLAGS="$(CFLAGS)" + $(MAKE) -C $(BOA_DIR)/src CC=$(CC) CFLAGS="$(CFLAGS) -DINET6 -DACCEPT_ON" %.o: %.c $(COMPILE) $(LUA_CFLAGS) -I$(BOA_DIR)/src $(FPIC) -c -o $@ $< diff --git a/libs/sgi-webuci/boa-patches/130-inet6_fix.patch b/libs/sgi-webuci/boa-patches/130-inet6_fix.patch new file mode 100644 index 000000000..b4fc570bc --- /dev/null +++ b/libs/sgi-webuci/boa-patches/130-inet6_fix.patch @@ -0,0 +1,16 @@ +Index: boa-0.94.13/src/compat.h +=================================================================== +--- boa-0.94.13.orig/src/compat.h 2002-07-23 17:50:29.000000000 +0200 ++++ boa-0.94.13/src/compat.h 2008-09-13 21:55:31.000000000 +0200 +@@ -70,8 +70,8 @@ + #endif + + #ifdef INET6 +-#define SOCKADDR sockaddr_storage +-#define S_FAMILY __s_family ++#define SOCKADDR sockaddr_in6 ++#define S_FAMILY sin6_family + #define SERVER_AF AF_INET6 + #else + #define SOCKADDR sockaddr_in + #define S_FAMILY sin_family diff --git a/libs/sgi-webuci/root/usr/lib/boa/luci.lua b/libs/sgi-webuci/root/usr/lib/boa/luci.lua index 6cb019d16..2bb9313a6 100644 --- a/libs/sgi-webuci/root/usr/lib/boa/luci.lua +++ b/libs/sgi-webuci/root/usr/lib/boa/luci.lua @@ -59,6 +59,7 @@ function handle_req(context) env.REMOTE_PORT = context.remote_port env.SERVER_ADDR = context.server_addr env.HTTP_COOKIE = context.cookie + env.HTTP_ACCEPT = context.http_accept env.SCRIPT_NAME = env.REQUEST_URI:sub(1, #env.REQUEST_URI - #env.PATH_INFO) luci.sgi.webuci.run(env, vars)