From fa89e011fb1c97b23aaf20feb31d61973cbcaea4 Mon Sep 17 00:00:00 2001 From: bol-van Date: Mon, 12 Jan 2026 18:32:52 +0300 Subject: [PATCH] nfqws2: align packet buffers --- nfq2/lua.c | 4 ++-- nfq2/nfqws.c | 6 +++--- nfq2/protocol.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nfq2/lua.c b/nfq2/lua.c index a5bef99..2b01742 100644 --- a/nfq2/lua.c +++ b/nfq2/lua.c @@ -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); diff --git a/nfq2/nfqws.c b/nfq2/nfqws.c index 4bf9df0..49fd22d 100644 --- a/nfq2/nfqws.c +++ b/nfq2/nfqws.c @@ -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(); diff --git a/nfq2/protocol.c b/nfq2/protocol.c index b73ec26..59ffbe4 100644 --- a/nfq2/protocol.c +++ b/nfq2/protocol.c @@ -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); */