Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

nfqws2: align packet buffers

This commit is contained in:
bol-van
2026-01-12 18:32:52 +03:00
parent 622a81001d
commit fa89e011fb
3 changed files with 6 additions and 6 deletions

View File

@@ -2212,7 +2212,7 @@ static int luacall_reconstruct_dissect(lua_State *L)
LUA_STACK_GUARD_ENTER(L)
size_t l;
uint8_t buf[RECONSTRUCT_MAX_SIZE];
uint8_t buf[RECONSTRUCT_MAX_SIZE] __attribute__((aligned(16)));
l = sizeof(buf);
bool ip6_preserve_next, badsum;
@@ -2471,7 +2471,7 @@ static int luacall_rawsend_dissect(lua_State *L)
uint32_t fwmark;
sockaddr_in46 sa;
bool b, badsum, ip6_preserve_next;
uint8_t buf[RECONSTRUCT_MAX_SIZE];
uint8_t buf[RECONSTRUCT_MAX_SIZE] __attribute__((aligned(16)));
len = sizeof(buf);
luaL_checktype(L,1,LUA_TTABLE);

View File

@@ -191,7 +191,7 @@ static int nfq_cb(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_da
char ifout[IFNAMSIZ], ifin[IFNAMSIZ];
size_t modlen;
uint32_t mark;
uint8_t mod[RECONSTRUCT_MAX_SIZE];
uint8_t mod[RECONSTRUCT_MAX_SIZE] __attribute__((aligned(16)));
ph = nfq_get_msg_packet_hdr(nfa);
id = ph ? ntohl(ph->packet_id) : 0;
@@ -321,7 +321,7 @@ static int nfq_main(void)
int res, fd, e;
ssize_t rd;
FILE *Fpid = NULL;
uint8_t buf[RECONSTRUCT_MAX_SIZE] __attribute__((aligned));
uint8_t buf[RECONSTRUCT_MAX_SIZE] __attribute__((aligned(16)));
if (*params.pidfile && !(Fpid = fopen(params.pidfile, "w")))
{
@@ -635,7 +635,7 @@ static int win_main()
WINDIVERT_ADDRESS wa;
char ifname[IFNAMSIZ];
int res=0;
uint8_t packet[RECONSTRUCT_MAX_SIZE];
uint8_t packet[RECONSTRUCT_MAX_SIZE] __attribute__((aligned(16)));
if (params.daemon) daemonize();

View File

@@ -1430,7 +1430,7 @@ bool IsMTProto(const uint8_t *data, size_t len)
if (len>=64)
{
/*
uint8_t decrypt[64];
uint8_t decrypt[64] __attribute__((aligned));
aes_ctr_crypt(data+8, 32, data+40, data, 64, decrypt);
return !memcmp(decrypt+56,"\xEF\xEF\xEF\xEF",4);
*/