* Add 'tunnel_address' support for json config parser
And allow ss-tunnel to use the newly introduced parser.
Signed-off-by: Adam Anonymous <anonymous_temp_user@yahoo.co.jp>
* Add "mode" support for jconf
Now jconf supports "mode" setting, allowed values are "tcp_only",
"tcp_and_udp" and "udp_only".
Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp>
* Use jconf "mode" for server/local/tunnel/manager
Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp>
* Add per-project vimrc to gitignore
As the coding style differs from kernel and other projects, so such
project vimrc should be helpful.
Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp>
Close#603
After use, sensitive data should be overwritten, but memset() and hand-written code can be silently stripped out by an optimizing compiler or by the linker.
The sodium_memzero() function tries to effectively zero len bytes starting at pnt, even if optimizations are being applied to the code.
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
redir.c:212:9: error: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘ssize_t’ [-Werror=format=]
LOGI("redir to %s:%d, len=%ld", ipstr, port, r);
^
* fix `ss-redir -v`.
It's now output messages while redirecting.
This is useful at the time building up a router.
* typo
* inet_ntop() -> dns_ntop()
* removed max().
max(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) => INET6_ADDRSTRLEN
- Added one macro to avoid dangling pointers
- Added two functions to perform NULL pointer check
since the allocation is not guaranteed by C library, although it
is a rare case, just for sanity
- Add NULL pointer check to brealloc() and bfree() and for sanity as well
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
errno is never set to zero by any system call or library function,
and it's programmer's resposibility to reset it before doing checks.
Otherwise the error might be misleading.
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>