diff --git a/ip2net/Makefile b/ip2net/Makefile index f5d36e8..97a53d7 100644 --- a/ip2net/Makefile +++ b/ip2net/Makefile @@ -1,6 +1,6 @@ CC ?= gcc -CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3 -CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch +CFLAGS += -std=gnu99 -O3 +CFLAGS_BSD = -Wno-address-of-packed-member CFLAGS_WIN = -static LIBS = LIBS_WIN = -lws2_32 diff --git a/mdig/Makefile b/mdig/Makefile index 27f539c..e6b4e54 100644 --- a/mdig/Makefile +++ b/mdig/Makefile @@ -1,5 +1,5 @@ CC ?= gcc -CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3 +CFLAGS += -std=gnu99 -O3 CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch CFLAGS_WIN = -static LIBS = -lpthread diff --git a/nfq/BSDmakefile b/nfq/BSDmakefile index 262553a..1717340 100644 --- a/nfq/BSDmakefile +++ b/nfq/BSDmakefile @@ -1,5 +1,5 @@ CC ?= cc -CFLAGS += -std=gnu99 -s -O3 -Wno-address-of-packed-member -Wno-logical-op-parentheses -Wno-switch +CFLAGS += -std=gnu99 -s -O3 -Wno-address-of-packed-member LIBS = -lz SRC_FILES = *.c crypto/*.c diff --git a/nfq/Makefile b/nfq/Makefile index 5439bdd..783f437 100644 --- a/nfq/Makefile +++ b/nfq/Makefile @@ -1,6 +1,6 @@ CC ?= gcc -CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3 -CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch +CFLAGS += -std=gnu99 -O3 +CFLAGS_BSD = -Wno-address-of-packed-member CFLAGS_MAC = -mmacosx-version-min=10.8 CFLAGS_CYGWIN = -Wno-address-of-packed-member -static LIBS_LINUX = -lnetfilter_queue -lnfnetlink -lz diff --git a/tpws/BSDmakefile b/tpws/BSDmakefile index 2d0c883..568f67b 100644 --- a/tpws/BSDmakefile +++ b/tpws/BSDmakefile @@ -1,5 +1,5 @@ CC ?= cc -CFLAGS += -std=gnu99 -s -O3 -Wno-logical-op-parentheses +CFLAGS += -std=gnu99 -s -O3 LIBS = -lz -lpthread SRC_FILES = *.c diff --git a/tpws/Makefile b/tpws/Makefile index 51d5030..52b72f7 100644 --- a/tpws/Makefile +++ b/tpws/Makefile @@ -1,6 +1,6 @@ CC ?= gcc -CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3 -CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch +CFLAGS += -std=gnu99 -O3 +CFLAGS_BSD = -Wno-address-of-packed-member LIBS = -lz -lpthread SRC_FILES = *.c diff --git a/tpws/helpers.c b/tpws/helpers.c index d7878b5..85954de 100644 --- a/tpws/helpers.c +++ b/tpws/helpers.c @@ -169,9 +169,9 @@ bool is_localnet(const struct sockaddr *a) // match 127.0.0.0/8, 0.0.0.0, ::1, ::0, :ffff:127.0.0.0/104, :ffff:0.0.0.0 return (a->sa_family==AF_INET && (IN_LOOPBACK(ntohl(((struct sockaddr_in *)a)->sin_addr.s_addr)) || INADDR_ANY == ntohl((((struct sockaddr_in *)a)->sin_addr.s_addr)))) || - (a->sa_family==AF_INET6 && (IN6_IS_ADDR_LOOPBACK(((struct sockaddr_in6 *)a)->sin6_addr.s6_addr) || - IN6_IS_ADDR_UNSPECIFIED(((struct sockaddr_in6 *)a)->sin6_addr.s6_addr) || - (IN6_IS_ADDR_V4MAPPED(((struct sockaddr_in6 *)a)->sin6_addr.s6_addr) && (IN_LOOPBACK(ntohl(IN6_EXTRACT_MAP4(((struct sockaddr_in6*)a)->sin6_addr.s6_addr))) || + (a->sa_family==AF_INET6 && (IN6_IS_ADDR_LOOPBACK(&((struct sockaddr_in6 *)a)->sin6_addr) || + IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *)a)->sin6_addr) || + (IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)a)->sin6_addr) && (IN_LOOPBACK(ntohl(IN6_EXTRACT_MAP4(((struct sockaddr_in6*)a)->sin6_addr.s6_addr))) || INADDR_ANY == ntohl(IN6_EXTRACT_MAP4(((struct sockaddr_in6*)a)->sin6_addr.s6_addr)))))); } bool is_linklocal(const struct sockaddr_in6 *a)