aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2016-05-10 22:36:35 +0000
committerLuka Perkov <luka@openwrt.org>2016-06-19 19:28:53 +0200
commitff4f769d2087c957492918ac8f8d1bdacab70b1d (patch)
tree0cb5e1681a70af322f029b7a22cac9a655f597a2 /package/network
parent091c856d0410753de51fd3bb5b66b9e79b1eeebf (diff)
downloadmaster-187ad058-ff4f769d2087c957492918ac8f8d1bdacab70b1d.tar.gz
master-187ad058-ff4f769d2087c957492918ac8f8d1bdacab70b1d.tar.bz2
master-187ad058-ff4f769d2087c957492918ac8f8d1bdacab70b1d.zip
xtables-addons: Fix Lua packet script implementation
lua_packet_segment parameter start has type char pointer; in function lua_tg it's assigned an uint16 value generating compiler warnings obviously indicating posssible seg fault problems. Fix the issue by using the correct skb functions so the parameter points to the position inside the sk_buff Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Stijn Cleynhens <stijn.cleynhens@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49331 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network')
-rw-r--r--package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch
index 06a4a1739a..ebc952bca3 100644
--- a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch
+++ b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch
@@ -13,6 +13,21 @@
{
uint32_t verdict;
lua_packet_segment *p;
+@@ -88,11 +88,11 @@ lua_tg(struct sk_buff *pskb, const struc
+ /* push the lua_packet_segment as a parameter */
+ p = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment));
+ if (pskb->mac_header)
+- p->start = pskb->mac_header;
++ p->start = skb_mac_header(pskb);
+ else if (pskb->network_header)
+- p->start = pskb->network_header;
++ p->start = skb_network_header(pskb);
+ else if (pskb->transport_header)
+- p->start = pskb->transport_header;
++ p->start = skb_transport_header(pskb);
+ p->offset = 0;
+ p->length = (unsigned long)pskb->tail - (unsigned long)p->start;
+ p->changes = NULL;
@@ -208,16 +208,16 @@ static bool load_script_into_state(uint3
* some workqueue initialization. So far this is done each time this function
* is called, subject to change.