drk1wi / portspoof

Portspoof
http://drk1wi.github.io/portspoof/
Other
964 stars 147 forks source link

Restore BSD support #11

Closed drk1wi closed 1 year ago

drk1wi commented 11 years ago

The relevant code is there... it's just a matter of time to sort some compilation issues.

loganaden commented 10 years 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 @@

include "connection.h"

include "Configuration.h"

+#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);

else

loganaden commented 10 years ago

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 :2 2 : No such file or directory. in Current language: auto; currently asm (gdb) bt

0 0x000008597823189a in kill () at :2

1 0x0000085978292a0a in abort () at /usr/src/lib/libc/stdlib/abort.c:70

2 0x0000085978e11a65 in pthread_mutex_unlock (mutexp=Variable "mutexp" is not available.

) at /usr/src/lib/librthread/rthread_sync.c:219

3 0x0000085775f0812e in process_connection (arg=0x3) at connection.cpp:309

4 0x0000085978e1027e in _rthread_start (v=Variable "v" is not available.

) at /usr/src/lib/librthread/rthread.c:128

5 0x000008597821d2ab in __tfork_thread ()

at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:75

Cannot access memory at address 0x85984877000

JustDevZero commented 8 years ago

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