mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-25 10:53:00 +08:00
Add Solaris support
This commit is contained in:
parent
d28f4df8e2
commit
a85553ad67
6
configure
vendored
6
configure
vendored
@ -30,6 +30,10 @@ isopenbsd() {
|
|||||||
uname -s | grep OpenBSD >/dev/null
|
uname -s | grep OpenBSD >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issolaris() {
|
||||||
|
[ "`uname -s`" = SunOS ]
|
||||||
|
}
|
||||||
|
|
||||||
check_compile() {
|
check_compile() {
|
||||||
printf "checking %s ... " "$1"
|
printf "checking %s ... " "$1"
|
||||||
printf "$3" > "$tmpc"
|
printf "$3" > "$tmpc"
|
||||||
@ -174,6 +178,8 @@ elif isbsd ; then
|
|||||||
echo "CFLAGS+=-DIS_BSD">>config.mak
|
echo "CFLAGS+=-DIS_BSD">>config.mak
|
||||||
isopenbsd && echo "CFLAGS+=-DIS_OPENBSD">>config.mak
|
isopenbsd && echo "CFLAGS+=-DIS_OPENBSD">>config.mak
|
||||||
make_cmd=gmake
|
make_cmd=gmake
|
||||||
|
elif issolaris; then
|
||||||
|
echo "CFLAGS+=-DIS_SOLARIS -D__EXTENSIONS__" >> config.mak
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Done, now run $make_cmd && $make_cmd install"
|
echo "Done, now run $make_cmd && $make_cmd install"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#undef _POSIX_C_SOURCE
|
#undef _POSIX_C_SOURCE
|
||||||
#define _POSIX_C_SOURCE 200809L
|
#define _POSIX_C_SOURCE 200809L
|
||||||
#define _DARWIN_C_SOURCE
|
#define _DARWIN_C_SOURCE
|
||||||
|
#define _XOPEN_SOURCE 600
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -787,8 +787,8 @@ void proxy_freeaddrinfo(struct addrinfo *res) {
|
|||||||
free(res);
|
free(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(IS_MAC) || defined(IS_OPENBSD)
|
#if defined(IS_MAC) || defined(IS_OPENBSD) || defined(IS_SOLARIS)
|
||||||
#ifdef IS_OPENBSD /* OpenBSD has its own incompatible getservbyname_r */
|
#if defined(IS_OPENBSD) || defined(IS_SOLARIS) /* OpenBSD and Solaris has its own incompatible getservbyname_r */
|
||||||
#define getservbyname_r mygetservbyname_r
|
#define getservbyname_r mygetservbyname_r
|
||||||
#endif
|
#endif
|
||||||
/* getservbyname on mac is using thread local storage, so we dont need mutex
|
/* getservbyname on mac is using thread local storage, so we dont need mutex
|
||||||
|
@ -38,6 +38,12 @@
|
|||||||
#include "core.h"
|
#include "core.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
#ifdef IS_SOLARIS
|
||||||
|
#ifndef s6_addr32
|
||||||
|
#define s6_addr32 _S6_un._S6_u32
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define satosin(x) ((struct sockaddr_in *) &(x))
|
#define satosin(x) ((struct sockaddr_in *) &(x))
|
||||||
#define SOCKADDR(x) (satosin(x)->sin_addr.s_addr)
|
#define SOCKADDR(x) (satosin(x)->sin_addr.s_addr)
|
||||||
#define SOCKADDR_2(x) (satosin(x)->sin_addr)
|
#define SOCKADDR_2(x) (satosin(x)->sin_addr)
|
||||||
@ -330,7 +336,11 @@ int close(int fd) {
|
|||||||
}
|
}
|
||||||
static int is_v4inv6(const struct in6_addr *a) {
|
static int is_v4inv6(const struct in6_addr *a) {
|
||||||
return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&
|
return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&
|
||||||
|
#ifdef IS_SOLARIS
|
||||||
|
a->s6_addr[8] == 0 && a->s6_addr[9] == 0 && a->s6_addr[10] == 0xff && a->s6_addr[11] == 0xff;
|
||||||
|
#else
|
||||||
a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;
|
a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
int connect(int sock, const struct sockaddr *addr, unsigned int len) {
|
int connect(int sock, const struct sockaddr *addr, unsigned int len) {
|
||||||
INIT();
|
INIT();
|
||||||
|
@ -10,7 +10,11 @@
|
|||||||
#undef _POSIX_C_SOURCE
|
#undef _POSIX_C_SOURCE
|
||||||
#define _POSIX_C_SOURCE 200809L
|
#define _POSIX_C_SOURCE 200809L
|
||||||
#undef _XOPEN_SOURCE
|
#undef _XOPEN_SOURCE
|
||||||
|
#ifdef IS_SOLARIS /* Solaris doesn't recognize this macro greater than 600 */
|
||||||
|
#define _XOPEN_SOURCE 600
|
||||||
|
#else
|
||||||
#define _XOPEN_SOURCE 700
|
#define _XOPEN_SOURCE 700
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user