Closed drk1wi closed 1 year ago
Hi,
I tried compiling it on OpenBSD.
SOL_IP isn't present on *BSD.
Here's a diff:
diff --git a/src/connection.cpp b/src/connection.cpp index c4a1685..4b0b6f1 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -43,6 +43,10 @@
+#ifndef SOL_IP +#define SOL_IP IPPROTO_IP +#endif + / ipstr has to be of length INET_ADDRSTRLEN or INET6_ADDRSTRLEN @@ -145,7 +149,7 @@ void* process_connection(void arg) original_port = ntohs(peer_sockaddr.sin_port);
if ( getsockopt (threads[tid].clients[i], SOL_IP, SO_ORIGINAL_DST, (struct sockaddr*)&peer_sockaddr,(socklen_t*) (socklen_t*) &peer_sockaddr_len )){
perror("Getsockopt failed: Have you set up your IPTABLES rules correctly ?");
goto close_socket;
}
@@ -306,4 +310,4 @@ void* process_connection(void *arg) }
return 0; -} \ No newline at end of file +}
Was able to compile, but ran into coredumps on OpenBSD.
Hint appreciated:
-> Verbose mode on. new conn - thread choosen: 9 - nr. of connections already in queue: 0
Program received signal SIGABRT, Aborted.
[Switching to thread 1021614]
0x000008597823189a in kill () at
) at /usr/src/lib/librthread/rthread_sync.c:219
) at /usr/src/lib/librthread/rthread.c:128
at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:75
Cannot access memory at address 0x85984877000
Something similar happens here... :(
Running FreeBSD:
ERROR on accept: Software caused connection abort ERROR on accept: Software caused connection abort ERROR on accept: Software caused connection abort new conn - thread choosen: 9 - nr. of connections already in queue: 0 ERROR on accept: Software caused connection abort ERROR on accept: Software caused connection abort ERROR on accept: Software caused connection abort ERROR on accept: Software caused connection abort Getsockopt failed: Protocol not available
The relevant code is there... it's just a matter of time to sort some compilation issues.