diff --git a/Makefile b/Makefile index 350d7b7..dd6ec49 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CC = i686-w64-mingw32-gcc WINDRES = i686-w64-mingw32-windres CFLAGS = --std=c99 -O2 -I contrib/WinDivert-1.2.0-rc-MINGW/include/ -mwindows \ - -mthreads -m32 -Wall + -mthreads -mno-ms-bitfields -m32 -Wall CLIBS = -lws2_32 -lkernel32 -L contrib/WinDivert-1.2.0-rc-MINGW/x86/ \ -lWinDivert -lcomctl32 -mwindows OBJS = main.o redirect.o domain.o diff --git a/redirect.c b/redirect.c index 333e102..1986fd8 100644 --- a/redirect.c +++ b/redirect.c @@ -701,7 +701,7 @@ static void handle_dns(HANDLE handle, PWINDIVERT_ADDRESS addr, size_t len = sizeof(struct dnshdr) + data_len + sizeof(struct dnsa); if (len > 512) // Max DNS packet size. return; - len += sizeof(WINDIVERT_IPHDR) + sizeof(WINDIVERT_UDPHDR) + len; + len += sizeof(WINDIVERT_IPHDR) + sizeof(WINDIVERT_UDPHDR); char buf[len + 8]; // 8 bytes extra. PWINDIVERT_IPHDR riphdr = (PWINDIVERT_IPHDR)buf;