Author: luka
Date: 2016-05-11 00:36:35 +0200 (Wed, 11 May 2016)
New Revision: 49331

Modified:
   
trunk/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch
Log:
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 <[email protected]>
Signed-off-by: Stijn Cleynhens <[email protected]>

Modified: 
trunk/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch
===================================================================
--- 
trunk/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch
   2016-05-10 22:36:33 UTC (rev 49330)
+++ 
trunk/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch
   2016-05-10 22:36:35 UTC (rev 49331)
@@ -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.
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to