Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Redsocks on M1 MacOS Monterey 12.5 #176

Open
tmaly1980 opened this issue Mar 21, 2023 · 1 comment
Open

Compiling Redsocks on M1 MacOS Monterey 12.5 #176

tmaly1980 opened this issue Mar 21, 2023 · 1 comment

Comments

@tmaly1980
Copy link

I am unable to compile redsocks on an M1 MacOS with Monterey.... when I run "make", I get this error:

bash-3.2$ make
cc -g -O2 -std=c99 -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE -D_GNU_SOURCE -Wall   -c -o parser.o parser.c
parser.c:354:6: error: implicit declaration of function 'inet_aton' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        if (inet_aton(token, &ia)) {
            ^
parser.c:354:6: note: did you mean 'inet_pton'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arpa/inet.h:78:7: note: 'inet_pton' declared here
int              inet_pton(int, const char *, void *);
                 ^
parser.c:411:6: error: implicit declaration of function 'inet_aton' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        if (inet_aton(host, &ia)) {
            ^
2 errors generated.
make: *** [parser.o] Error 1

I've looked in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arpa/inet.h and notice the following definitions:

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
int              ascii2addr(int, const char *, void *);
char            *addr2ascii(int, const void *, int, char *);
int              inet_aton(const char *, struct in_addr *);
in_addr_t        inet_lnaof(struct in_addr);
struct in_addr   inet_makeaddr(in_addr_t, in_addr_t);
in_addr_t        inet_netof(struct in_addr);
in_addr_t        inet_network(const char *);
char            *inet_net_ntop(int, const void *, int, char *, __darwin_size_t);
int              inet_net_pton(int, const char *, void *, __darwin_size_t);
char            *inet_neta(in_addr_t, char *, __darwin_size_t);
unsigned int     inet_nsap_addr(const char *, unsigned char *, int);
char    *inet_nsap_ntoa(int, const unsigned char *, char *);
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */

There are no definitions of inet_aton() elsewhere that I can find.

Any help in fixing this?

@codievilky
Copy link

do you fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants