Skip to content

Commit 0446b14

Browse files
author
bol-van
committed
AI inspired fixes
1 parent 97cd8ce commit 0446b14

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lua/zapret-auto.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function automate_host_record(desync)
5858
end
5959
-- per-connection storage
6060
function automate_conn_record(desync)
61+
if not desync.track then return nil end
6162
if not desync.track.lua_state.automate then
6263
desync.track.lua_state.automate = {}
6364
end

nfq2/lua.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,11 +1278,11 @@ void lua_pushf_iphdr(lua_State *L, const struct ip *ip, size_t len)
12781278
lua_pushf_int(L,"ip_off",ntohs(ip->ip_off));
12791279
lua_pushf_int(L,"ip_ttl",ip->ip_ttl);
12801280
lua_pushf_int(L,"ip_p",ip->ip_p);
1281-
lua_pushf_int(L,"ip_sum",ip->ip_sum);
1281+
lua_pushf_int(L,"ip_sum",ntohs(ip->ip_sum));
12821282
lua_pushf_raw(L,"ip_src",&ip->ip_src,sizeof(struct in_addr));
12831283
lua_pushf_raw(L,"ip_dst",&ip->ip_dst,sizeof(struct in_addr));
12841284
if (b_has_opt)
1285-
lua_pushf_raw(L,"options",(uint8_t*)(ip+1),hl-sizeof(struct tcphdr));
1285+
lua_pushf_raw(L,"options",(uint8_t*)(ip+1),hl-sizeof(struct ip));
12861286
}
12871287
else
12881288
lua_pushnil(L);

0 commit comments

Comments
 (0)