semigodking/redsocks

macos 12.2.1 编译失败

langlanglanglanglang opened this issue · 2 comments

redsocks2 git:(master) ✗ make
Compile with OpenSSL by default. To compile with PolarSSL, run 'make USE_CRYPTO_POLARSSL=true' instead.
cc -fPIC -O3 -D_BSD_SOURCE -D_DEFAULT_SOURCE -Wall -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib -Ixnu/12.2 -DUSE_CRYPTO_OPENSSL -c -o base.o base.c
clang: warning: argument unused during compilation: '-L/usr/local/opt/openssl/lib' [-Wunused-command-line-argument]
In file included from base.c:41:
xnu/12.2/net/pfvar.h:1:1: error: expected identifier or '('
404: Not Found
^
In file included from base.c:59:
In file included from ./redsocks.h:7:
./list.h:34:9: warning: 'LIST_HEAD' macro redefined [-Wmacro-redefined]
#define LIST_HEAD(name)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/queue.h:465:9: note: previous definition is here
#define LIST_HEAD(name, type)
^
base.c:189:23: error: variable has incomplete type 'struct pfioc_natlook'
struct pfioc_natlook nl;
^
base.c:189:9: note: forward declaration of 'struct pfioc_natlook'
struct pfioc_natlook nl;
^
base.c:193:17: error: invalid application of 'sizeof' to an incomplete type 'struct pfioc_natlook'
memset(&nl, 0, sizeof(struct pfioc_natlook));
^ ~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:77:33: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^~~~~~~~~~~
base.c:189:9: note: forward declaration of 'struct pfioc_natlook'
struct pfioc_natlook nl;
^
base.c:200:17: error: use of undeclared identifier 'PF_OUT'
nl.direction = PF_OUT;
^
base.c:202:18: error: use of undeclared identifier 'DIOCNATLOOK'
if (ioctl(pffd, DIOCNATLOOK, &nl) != 0) {
^
base.c:204:19: error: use of undeclared identifier 'PF_IN'
nl.direction = PF_IN; // required to redirect local packets
^
base.c:205:20: error: use of undeclared identifier 'DIOCNATLOOK'
if (ioctl(pffd, DIOCNATLOOK, &nl) != 0) {
^
1 warning and 7 errors generated.
make: *** [base.o] Error 1

已经执行过 git apply patches/disable-ss.patch了