mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-26 20:20:53 +03:00
tpws: connect-bind-addr support %iface for link locals
This commit is contained in:
parent
7894796bdb
commit
e86fc2e7b5
@ -136,9 +136,9 @@ static void exithelp(void)
|
|||||||
" --bind-wait-ip-linklocal=<sec>\t\t; (prefer) accept only LL first N seconds then any (unwanted) accept only globals first N seconds then LL\n"
|
" --bind-wait-ip-linklocal=<sec>\t\t; (prefer) accept only LL first N seconds then any (unwanted) accept only globals first N seconds then LL\n"
|
||||||
" --bind-wait-only\t\t\t; wait for bind conditions satisfaction then exit. return code 0 if success.\n"
|
" --bind-wait-only\t\t\t; wait for bind conditions satisfaction then exit. return code 0 if success.\n"
|
||||||
" * multiple binds are supported. each bind-addr, bind-iface* start new bind\n"
|
" * multiple binds are supported. each bind-addr, bind-iface* start new bind\n"
|
||||||
|
" --connect-bind-addr=<v4_addr>|<v6_addr> ; address for outbound connections. for v6 link locals append %%interface_name\n"
|
||||||
" --port=<port>\t\t\t\t; only one port number for all binds is supported\n"
|
" --port=<port>\t\t\t\t; only one port number for all binds is supported\n"
|
||||||
" --socks\t\t\t\t; implement socks4/5 proxy instead of transparent proxy\n"
|
" --socks\t\t\t\t; implement socks4/5 proxy instead of transparent proxy\n"
|
||||||
" --connect-bind-addr=<v4_addr>|<v6_addr> ; address for outbound connections\n"
|
|
||||||
" --no-resolve\t\t\t\t; disable socks5 remote dns ability\n"
|
" --no-resolve\t\t\t\t; disable socks5 remote dns ability\n"
|
||||||
" --resolver-threads=<int>\t\t; number of resolver worker threads\n"
|
" --resolver-threads=<int>\t\t; number of resolver worker threads\n"
|
||||||
" --local-rcvbuf=<bytes>\n"
|
" --local-rcvbuf=<bytes>\n"
|
||||||
@ -788,6 +788,8 @@ void parse_params(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
case 54: /* connect-bind-addr */
|
case 54: /* connect-bind-addr */
|
||||||
{
|
{
|
||||||
|
char *p = strchr(optarg,'%');
|
||||||
|
if (p) *p++=0;
|
||||||
if (inet_pton(AF_INET, optarg, ¶ms.connect_bind4.sin_addr))
|
if (inet_pton(AF_INET, optarg, ¶ms.connect_bind4.sin_addr))
|
||||||
{
|
{
|
||||||
params.connect_bind4.sin_family = AF_INET;
|
params.connect_bind4.sin_family = AF_INET;
|
||||||
@ -795,6 +797,7 @@ void parse_params(int argc, char *argv[])
|
|||||||
else if (inet_pton(AF_INET6, optarg, ¶ms.connect_bind6.sin6_addr))
|
else if (inet_pton(AF_INET6, optarg, ¶ms.connect_bind6.sin6_addr))
|
||||||
{
|
{
|
||||||
params.connect_bind6.sin6_family = AF_INET6;
|
params.connect_bind6.sin6_family = AF_INET6;
|
||||||
|
if (p && *p) params.connect_bind6.sin6_scope_id=if_nametoindex(p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user