mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-11 17:29:16 +05:00
tpws: fix ipv6 macros on bsd
This commit is contained in:
parent
93aa69ff7b
commit
881061c918
@ -1,6 +1,6 @@
|
|||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3
|
CFLAGS += -std=gnu99 -O3
|
||||||
CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch
|
CFLAGS_BSD = -Wno-address-of-packed-member
|
||||||
CFLAGS_WIN = -static
|
CFLAGS_WIN = -static
|
||||||
LIBS =
|
LIBS =
|
||||||
LIBS_WIN = -lws2_32
|
LIBS_WIN = -lws2_32
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3
|
CFLAGS += -std=gnu99 -O3
|
||||||
CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch
|
CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch
|
||||||
CFLAGS_WIN = -static
|
CFLAGS_WIN = -static
|
||||||
LIBS = -lpthread
|
LIBS = -lpthread
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
CC ?= cc
|
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
|
LIBS = -lz
|
||||||
SRC_FILES = *.c crypto/*.c
|
SRC_FILES = *.c crypto/*.c
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3
|
CFLAGS += -std=gnu99 -O3
|
||||||
CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch
|
CFLAGS_BSD = -Wno-address-of-packed-member
|
||||||
CFLAGS_MAC = -mmacosx-version-min=10.8
|
CFLAGS_MAC = -mmacosx-version-min=10.8
|
||||||
CFLAGS_CYGWIN = -Wno-address-of-packed-member -static
|
CFLAGS_CYGWIN = -Wno-address-of-packed-member -static
|
||||||
LIBS_LINUX = -lnetfilter_queue -lnfnetlink -lz
|
LIBS_LINUX = -lnetfilter_queue -lnfnetlink -lz
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
CC ?= cc
|
CC ?= cc
|
||||||
CFLAGS += -std=gnu99 -s -O3 -Wno-logical-op-parentheses
|
CFLAGS += -std=gnu99 -s -O3
|
||||||
LIBS = -lz -lpthread
|
LIBS = -lz -lpthread
|
||||||
SRC_FILES = *.c
|
SRC_FILES = *.c
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
CFLAGS += -std=gnu99 -Wno-logical-op-parentheses -O3
|
CFLAGS += -std=gnu99 -O3
|
||||||
CFLAGS_BSD = -Wno-address-of-packed-member -Wno-switch
|
CFLAGS_BSD = -Wno-address-of-packed-member
|
||||||
LIBS = -lz -lpthread
|
LIBS = -lz -lpthread
|
||||||
SRC_FILES = *.c
|
SRC_FILES = *.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
|
// 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)) ||
|
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)))) ||
|
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) ||
|
(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.s6_addr) ||
|
IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *)a)->sin6_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))) ||
|
(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))))));
|
INADDR_ANY == ntohl(IN6_EXTRACT_MAP4(((struct sockaddr_in6*)a)->sin6_addr.s6_addr))))));
|
||||||
}
|
}
|
||||||
bool is_linklocal(const struct sockaddr_in6 *a)
|
bool is_linklocal(const struct sockaddr_in6 *a)
|
||||||
|
Loading…
Reference in New Issue
Block a user