Problem
The previous post shows you how you can configure the outgoing ip in antinat but if you have multiple ips and you want to use all of them and you want to be able to control which one to be used for certain things that patch doesn't do enough for you.
Solution
Antinat should bind the ougoing connection on the same ip on which it receives the connection from the client.
So if you want to use a different ip just set your configure your socks settings in the browser or proxifier to the ip you want antinat to use.
And here's the patch to let you do that ...
[download id="24"]
This patch is incompatible with the one on the previous post, you can either have that one or this one so make sure you apply it on the original antinat source.
Questions or suggestions are welcome as always ...
Hi,
I’ve applied your patch successfully but it is not compiling anymore, is there an step that I’m missing?
Did you apply it to the same version as I did ?
Can you post the errors that you are getting where you try to compile this?
Yes I’ve applied the patch to same version you used 0.90, here is the output of the patch:
10-164-117-11 antinat-0.90_outgoing # patch –verbose -p1 < ../antinat_outgoing_same_as_incomming.diff
Hmm… Looks like a unified diff to me…
The text leading up to this was:
————————–
|diff -ur antinat-0.90/client/an_direct.c antinat-0.90_outgoing/client/an_direct.c
|— antinat-0.90/client/an_direct.c 2005-01-09 05:44:52.000000000 +0200
|+++ antinat-0.90_outgoing/client/an_direct.c 2007-07-22 14:37:20.000000000 +0300
————————–
Patching file client/an_direct.c using Plan A…
Hunk #1 succeeded at 14.
Hunk #2 succeeded at 23.
Hunk #3 succeeded at 44.
Hmm… The next patch looks like a unified diff to me…
The text leading up to this was:
————————–
|diff -ur antinat-0.90/client/an_internals.h antinat-0.90_outgoing/client/an_internals.h
|— antinat-0.90/client/an_internals.h 2005-01-09 03:46:56.000000000 +0200
|+++ antinat-0.90_outgoing/client/an_internals.h 2007-07-17 10:17:17.000000000 +0300
————————–
Patching file client/an_internals.h using Plan A…
Hunk #1 succeeded at 30.
Hmm… The next patch looks like a unified diff to me…
The text leading up to this was:
————————–
|diff -ur antinat-0.90/client/an_proxy.c antinat-0.90_outgoing/client/an_proxy.c
|— antinat-0.90/client/an_proxy.c 2005-01-09 03:46:56.000000000 +0200
|+++ antinat-0.90_outgoing/client/an_proxy.c 2007-07-21 15:02:36.000000000 +0300
————————–
Patching file client/an_proxy.c using Plan A…
Hunk #1 succeeded at 152.
Hunk #2 succeeded at 161.
Hmm… The next patch looks like a unified diff to me…
The text leading up to this was:
————————–
|diff -ur antinat-0.90/client/antinat.h antinat-0.90_outgoing/client/antinat.h
|— antinat-0.90/client/antinat.h 2005-01-09 03:46:56.000000000 +0200
|+++ antinat-0.90_outgoing/client/antinat.h 2007-07-22 14:06:48.000000000 +0300
————————–
Patching file client/antinat.h using Plan A…
Hunk #1 succeeded at 24.
Hunk #2 succeeded at 41.
Hunk #3 succeeded at 61.
Hunk #4 succeeded at 116.
Hunk #5 succeeded at 173.
Hmm… The next patch looks like a unified diff to me…
The text leading up to this was:
————————–
|diff -ur antinat-0.90/server/an_serv.h antinat-0.90_outgoing/server/an_serv.h
|— antinat-0.90/server/an_serv.h 2005-01-09 03:45:41.000000000 +0200
|+++ antinat-0.90_outgoing/server/an_serv.h 2007-07-22 13:52:33.000000000 +0300
————————–
Patching file server/an_serv.h using Plan A…
Hunk #1 succeeded at 6.
Hunk #2 succeeded at 33.
Hunk #3 succeeded at 64.
Hunk #4 succeeded at 128.
Hunk #5 succeeded at 174.
Hunk #6 succeeded at 260.
Hmm… The next patch looks like a unified diff to me…
The text leading up to this was:
————————–
|diff -ur antinat-0.90/server/socks4.c antinat-0.90_outgoing/server/socks4.c
|— antinat-0.90/server/socks4.c 2005-01-09 05:40:43.000000000 +0200
|+++ antinat-0.90_outgoing/server/socks4.c 2007-07-21 15:30:14.000000000 +0300
————————–
Patching file server/socks4.c using Plan A…
Hunk #1 succeeded at 197.
Hmm… The next patch looks like a unified diff to me…
The text leading up to this was:
————————–
|diff -ur antinat-0.90/server/socks5.c antinat-0.90_outgoing/server/socks5.c
|— antinat-0.90/server/socks5.c 2005-01-09 05:40:52.000000000 +0200
|+++ antinat-0.90_outgoing/server/socks5.c 2007-07-21 14:58:22.000000000 +0300
————————–
Patching file server/socks5.c using Plan A…
Hunk #1 succeeded at 692.
Hmm… Ignoring the trailing garbage.
done
Once I run make I got this:
10-164-117-11 antinat-0.90_outgoing # make
list='client server etc man tests'; for subdir in $list; do \
cd $subdir && make all && cd ..; \
done
make[1]: Entering directory `/root/antinat/antinat-0.90_outgoing/client'
/bin/sh ..//libtool –mode=compile gcc -I/usr/include -I. -c an_proxy.c -o an_proxy.lo
rm -f .libs/an_proxy.lo
gcc -I/usr/include -I. -c an_proxy.c -fPIC -DPIC -o .libs/an_proxy.lo
In file included from an_proxy.c:10:
an_internals.h:33:23: error: ../common.h: No such file or directory
In file included from an_proxy.c:16:
antinat.h:51: error: expected specifier-qualifier-list before 'SOCKET'
antinat.h:119: error: expected declaration specifiers or '…' before 'conn_t'
antinat.h:125: error: expected declaration specifiers or '…' before 'conn_t'
an_proxy.c: In function 'an_new_connection':
an_proxy.c:26: error: 'st_proxy' has no member named 'connection'
an_proxy.c:26: error: 'SOCKET' undeclared (first use in this function)
an_proxy.c:26: error: (Each undeclared identifier is reported only once
an_proxy.c:26: error: for each function it appears in.)
an_proxy.c:27: error: 'st_proxy' has no member named 'blocking'
an_proxy.c:28: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c:29: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c:30: error: 'st_proxy' has no member named 'mode'
an_proxy.c:31: error: 'st_proxy' has no member named 'proxy_user'
an_proxy.c:32: error: 'st_proxy' has no member named 'proxy_pass'
an_proxy.c:33: error: 'st_proxy' has no member named 'authmask'
an_proxy.c:34: error: 'st_proxy' has no member named 'local'
an_proxy.c:35: error: 'st_proxy' has no member named 'peer'
an_proxy.c: In function 'an_set_proxy':
an_proxy.c:53: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c:56: error: 'st_proxy' has no member named 'proxy_pf'
an_proxy.c:66: error: 'st_proxy' has no member named 'proxy_port'
an_proxy.c:67: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c:68: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c:69: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c:70: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c:72: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c: In function 'an_unset_proxy':
an_proxy.c:83: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c:84: error: 'st_proxy' has no member named 'proxy_pf'
an_proxy.c:85: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c:86: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c:87: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c:88: error: 'st_proxy' has no member named 'proxy_port'
an_proxy.c: In function 'an_connect_tohostname':
an_proxy.c:140: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c: At top level:
an_proxy.c:155: error: expected declaration specifiers or '…' before 'SOCKADDR'
an_proxy.c:155: error: expected declaration specifiers or '…' before 'conn_t'
an_proxy.c:156: error: conflicting types for 'an_connect_tosockaddr'
antinat.h:119: error: previous declaration of 'an_connect_tosockaddr' was here
an_proxy.c: In function 'an_connect_tosockaddr':
an_proxy.c:159: error: 'sa' undeclared (first use in this function)
an_proxy.c:162: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c:164: error: 'sconn' undeclared (first use in this function)
an_proxy.c:164: error: too many arguments to function 'an_direct_connect_tosockaddr'
an_proxy.c: In function 'an_bind_tohostname':
an_proxy.c:183: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c: At top level:
an_proxy.c:196: error: expected declaration specifiers or '…' before 'SOCKADDR'
an_proxy.c:197: error: conflicting types for 'an_bind_tosockaddr'
antinat.h:115: error: previous declaration of 'an_bind_tosockaddr' was here
an_proxy.c: In function 'an_bind_tosockaddr':
an_proxy.c:200: error: 'sa' undeclared (first use in this function)
an_proxy.c:203: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c: At top level:
an_proxy.c:217: error: expected declaration specifiers or '…' before 'SOCKADDR'
an_proxy.c:218: error: conflicting types for 'an_getsockname'
antinat.h:136: error: previous declaration of 'an_getsockname' was here
an_proxy.c: In function 'an_getsockname':
an_proxy.c:221: error: 'sa' undeclared (first use in this function)
an_proxy.c:224: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c: At top level:
an_proxy.c:237: error: expected declaration specifiers or '…' before 'SOCKADDR'
an_proxy.c:238: error: conflicting types for 'an_getpeername'
antinat.h:135: error: previous declaration of 'an_getpeername' was here
an_proxy.c: In function 'an_getpeername':
an_proxy.c:241: error: 'sa' undeclared (first use in this function)
an_proxy.c:244: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c: In function 'an_listen':
an_proxy.c:262: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c: At top level:
an_proxy.c:275: error: expected declaration specifiers or '…' before 'SOCKADDR'
an_proxy.c:276: error: conflicting types for 'an_accept'
antinat.h:113: error: previous declaration of 'an_accept' was here
an_proxy.c: In function 'an_accept':
an_proxy.c:280: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c:282: error: 'sa' undeclared (first use in this function)
an_proxy.c: In function 'an_close':
an_proxy.c:297: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c: In function 'an_destroy':
an_proxy.c:318: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c:320: error: 'st_proxy' has no member named 'proxy_user'
an_proxy.c:321: error: 'st_proxy' has no member named 'proxy_user'
an_proxy.c:322: error: 'st_proxy' has no member named 'proxy_pass'
an_proxy.c:323: error: 'st_proxy' has no member named 'proxy_pass'
an_proxy.c:325: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c:326: error: 'st_proxy' has no member named 'proxy_hostname'
an_proxy.c: In function 'an_clear_authschemes':
an_proxy.c:336: error: 'st_proxy' has no member named 'authmask'
an_proxy.c: In function 'an_set_authscheme':
an_proxy.c:347: error: 'st_proxy' has no member named 'authmask'
an_proxy.c:349: error: 'st_proxy' has no member named 'authmask'
an_proxy.c:349: error: 'st_proxy' has no member named 'authmask'
an_proxy.c: In function 'an_set_credentials':
an_proxy.c:359: error: 'st_proxy' has no member named 'proxy_user'
an_proxy.c:360: error: 'st_proxy' has no member named 'proxy_user'
an_proxy.c:361: error: 'st_proxy' has no member named 'proxy_pass'
an_proxy.c:362: error: 'st_proxy' has no member named 'proxy_pass'
an_proxy.c:365: error: 'st_proxy' has no member named 'proxy_user'
an_proxy.c:367: error: 'st_proxy' has no member named 'proxy_user'
an_proxy.c:368: error: 'st_proxy' has no member named 'proxy_user'
an_proxy.c:370: error: 'st_proxy' has no member named 'proxy_user'
an_proxy.c:374: error: 'st_proxy' has no member named 'proxy_pass'
an_proxy.c:376: error: 'st_proxy' has no member named 'proxy_pass'
an_proxy.c:377: error: 'st_proxy' has no member named 'proxy_pass'
an_proxy.c:379: error: 'st_proxy' has no member named 'proxy_pass'
an_proxy.c: In function 'an_send':
an_proxy.c:390: error: 'st_proxy' has no member named 'proxy_type'
an_proxy.c: In function 'an_recv':
an_proxy.c:409: error: 'st_proxy' has no member named 'proxy_type'
make[1]: *** [an_proxy.lo] Error 1
make[1]: Leaving directory `/root/antinat/antinat-0.90_outgoing/client'
/bin/sh: line 1: cd: server: No such file or directory
/bin/sh: line 1: cd: etc: No such file or directory
/bin/sh: line 1: cd: man: No such file or directory
/bin/sh: line 1: cd: tests: No such file or directory
make: *** [all-recurse] Error 1
do you know what is missing, or what I'm I doing wrong?