diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2016-04-28 11:18:56 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2016-04-28 11:45:43 +0200 |
commit | 312cb987f9612f1a649e51c1474b5c71b85e2666 (patch) | |
tree | b502fca14f6a5217e5b59bd334e4d85656a5aac8 /package/network | |
parent | eb529d26255a9a1fbeadfdaa3b5cdf47e43e4715 (diff) | |
download | mtk-20170518-312cb987f9612f1a649e51c1474b5c71b85e2666.zip mtk-20170518-312cb987f9612f1a649e51c1474b5c71b85e2666.tar.gz mtk-20170518-312cb987f9612f1a649e51c1474b5c71b85e2666.tar.bz2 |
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>
Diffstat (limited to 'package/network')
-rw-r--r-- | package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch | 15 |
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 06a4a17..ebc952b 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. |