ugly workarounds are reverted; forced macro satosin(x) undef'ed; added a new configure file path for haiku

pull/340/head
ethanf89 2020-08-15 22:16:33 +08:00
parent e706ca0bc7
commit 5c8de78c79
3 changed files with 9 additions and 15 deletions

2
README
View File

@ -16,7 +16,7 @@ ProxyChains-NG ver 4.14 README
If your program doesn't work with proxychains, consider using an
iptables based solution instead; this is much more robust.
Supported Platforms: Linux, BSD, Mac.
Supported Platforms: Linux, BSD, Mac, Haiku.
*********** ATTENTION ***********

View File

@ -74,11 +74,14 @@ char *get_config_path(char* default_path, char* pbuf, size_t bufsize) {
// priority 3; $HOME/.proxychains/proxychains.conf
path = getenv("HOME");
#ifdef IS_HAIKU
snprintf(pbuf, bufsize, "%s/config/settings/%s", path, PROXYCHAINS_CONF_FILE);
#else
snprintf(pbuf, bufsize, "%s/.proxychains/%s", path, PROXYCHAINS_CONF_FILE);
#endif
path = pbuf;
if(check_path(path))
goto have;
// priority 3b: ~/config/settings/proxychains.conf (for haiku)
path = getenv("HOME");
snprintf(pbuf, bufsize, "%s/config/settings/%s", path, PROXYCHAINS_CONF_FILE);
path = pbuf;
if(check_path(path))
goto have;

View File

@ -38,10 +38,7 @@
#include "core.h"
#include "common.h"
#ifdef IS_HAIKU
#undef satosin // to prevent macro redefinition
#endif
#undef satosin
#define satosin(x) ((struct sockaddr_in *) &(x))
#define SOCKADDR(x) (satosin(x)->sin_addr.s_addr)
#define SOCKADDR_2(x) (satosin(x)->sin_addr)
@ -686,13 +683,7 @@ int pc_getnameinfo(const struct sockaddr *sa, socklen_t salen,
return 0;
}
#ifdef IS_HAIKU
struct hostent *gethostbyaddr(const char *address, socklen_t length, int type) {
socklen_t len = length;
const char* addr = address;
#else
struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) {
#endif
INIT();
PDEBUG("TODO: proper gethostbyaddr hook\n");