darkk/redsocks — Issue #16: compilation
Author: capslock66
Created: 2011-11-08 09:53:09+00:00
State: open

Hi.
I work since 3 months on a reverse tethering program for android.

I have problem with the redsocks program .I want to forward UDP (DNS)
The packet send from redsocks is well received in my java program. (rfc1928-socks5.txt -> UDP ASSOCIATE)
I decode the stream (reserved2 frag1 addrType1 adrN port2 dataN) send by redsocks to remove the header and pass the buffer to my host .
Host respond correctly (with dns answer),
I add an header (reserved2 frag1 addrType1 adrN port2 dataN) and send back to redsocks.

I got this error in redsock log :
1320607466.643320 redudp.c:471 redudp_pkt_from_socks(...) [192.168.1.2:62473->127.0.0.1:9500]: Got packet from unexpected address 127.0.0.1:9500.

It seams that redudp_pkt_from_socks() don't parse the header correctly

if (memcmp(&udprelayaddr, &client->udprelayaddr, sizeof(udprelayaddr)) != 0) {
char buf[INET6_ADDRSTRLEN];
const char *addr = inet_ntop(udprelayaddr.sin_family, &udprelayaddr.sin_addr, buf, sizeof(buf));
redudp_log_error(client, LOG_NOTICE, "Got packet from unexpected address %s:%u.",
addr ? addr : "?", ntohs(udprelayaddr.sin_port));
return;
}

So I would like to compile the library to add traces (client->udprelayaddr) to understand the problem.

The question is how to compile redsocks (for android) ???
I am a basically a windows developper.

I installed kunbuntu on a virtual machine to compile, but when I run 'make' I have this error :
utils.h:6:19: fatal error: event.h: No such file or directory

Libevent is required. Do I need to add an "include" tag somewhere with the correct path ?
Do I have to compile libevent first and how ?

Any help ???
Thanks in adance