Commit Graph
592 Commits
Author SHA1 Message Date
Max Lv bdef06618d Fix #708 2016-07-06 11:09:59 +08:00
Max Lv 4a0d37afda Update makefile 2016-07-04 21:07:53 +08:00
Max Lv 2643de44f2 Clean up 2016-07-04 18:23:17 +08:00
anonymous-contributor af69798355 New jconf parameters (#695)
* 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>
2016-06-30 23:19:13 -05:00
Max Lv bf210be2b7 Refine #690 2016-06-28 15:35:16 +08:00
Max Lv 55dea8b973 Fix #690 2016-06-28 15:33:55 +08:00
Max Lv 1e8022c3b7 Refine #682 2016-06-21 15:24:49 +08:00
Max Lv 642b5c900d Fix #678 2016-06-18 12:36:51 +08:00
cs17899219 d33b865ec7 Add a signal SIGUSR1 for safely stop the server (#677) 2016-06-14 21:29:06 -05:00
Max Lv 00209ab2ea Revert "Add APIs for non thread safe usage of shadowsocks-libev library"
This reverts commit 3e4c922363.
2016-06-14 09:15:58 +08:00
Max Lv 3e4c922363 Add APIs for non thread safe usage of shadowsocks-libev library 2016-06-13 17:47:11 +08:00
Max Lv 658703a1bd Fix #673 2016-06-12 09:09:03 +08:00
Max Lv a9b85a5216 Refine #669: Bind to loopback for local resolver 2016-06-09 08:42:45 +08:00
Boyuan Yang 2bf2d0787d Fix typo in source code (#666) 2016-06-06 05:30:43 -05:00
Max Lv fd422008b7 Avoid linking issues on Android 2016-06-05 14:45:01 +08:00
Max Lv 6fc1dccc58 Rename libshadowsocks to libshadowsocks-libev 2016-06-01 18:12:27 +08:00
Max Lv ba7f1565ad Fix #650 2016-05-27 12:13:09 +00:00
Max Lv 0cfae045e8 Fix #648 2016-05-26 14:35:02 +08:00
Max Lv f1464caca7 Fix a typo #642 2016-05-23 14:33:40 +08:00
Max Lv bddff70661 Refine ss-nat scripts 2016-05-23 13:31:30 +08:00
Max Lv fe22a6c90b Refine error handling of connect() 2016-05-23 12:07:36 +08:00
Kim 342bd3f776 Fix ipv6 address format in log message 2016-05-08 17:34:54 +08:00
Max Lv fd4adca789 Fix #627 2016-05-06 15:36:37 +08:00
Max Lv a73fe213a6 Refine the output 2016-05-06 15:16:27 +08:00
Max Lv e3deb0668d Fix the mismatch types 2016-05-06 15:10:09 +08:00
Max Lv bb50fc22ca Add option for binding to address #626 2016-05-06 14:52:33 +08:00
Max Lv 04cd8884c0 Fix a typo 2016-05-06 14:08:53 +08:00
Max Lv 41d93b126a Fix #626 2016-05-06 13:23:18 +08:00
Max Lv 72ee77ea35 Fix #615 2016-04-28 10:34:26 +08:00
Syrone Wong 7481ffffc7 clarify encrypt method info
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-04-24 21:25:26 +08:00
Kim 08f873adc7 Roll up year to 2016 2016-04-22 22:50:26 +08:00
Kim b3b522fd5e Fix missing leading space in macro LOGI() 2016-04-22 22:38:51 +08:00
Syrone Wong 0bbf6c36a7 use sodium_memzero() to clear sensitive data
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>
2016-04-22 18:00:19 +08:00
Kim c9098f40a5 Add friendly IP_TRANSPARENT fatal message 2016-04-21 14:54:17 +08:00
Kim dfa9e17c1b Add help option
* updated cli option 'help'

- all 5 apps supports cli option '-h' without error exit code
- supports long option '--help'

* fixed bad line brake
2016-04-21 06:22:58 +08:00
YumeMichi ebf24c1c01 Fix compile on 32-bit machine (#593)
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);
         ^
2016-04-19 15:52:07 +08:00
Kim 3e0952de52 Refine verbose output in redir mode
* 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
2016-04-19 14:05:12 +08:00
Max Lv 6c2c49ad60 Fix #586 2016-04-17 20:03:36 +08:00
Max Lv ac5f26c6fa Fix #585 2016-04-17 19:38:10 +08:00
Max Lv 8701f1dc65 Add missing headers 2016-04-16 01:02:12 +08:00
Max Lv 2363acf1f7 Fix a typo 2016-04-16 00:58:13 +08:00
Max Lv 114128668c Refine helper functions 2016-04-16 00:43:27 +08:00
Syrone Wong ebe79bbbd8 Refine memory management (#579)
- 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>
2016-04-15 09:16:38 -07:00
Syrone Wong 53c6a09b93 Reset errno to 0 before checking it
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>
2016-04-15 08:35:16 -07:00
Syrone Wong 06d92c923c compare port as well
The whole remote_ctx is inserted into the cache and sockaddr_storage contains
both address and port.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-04-15 08:34:35 -07:00
H2NCH2COOH 43fde8d39c Fix bug for ss-server udp sendto_remote error (#578) 2016-04-09 20:00:15 -07:00
H2NCH2COOH 117ddf4f33 Fix bug for ss-server when udp is sent with host not ip 2016-04-09 08:06:51 -07:00
Syrone Wong a17d2f19ac Fix sockaddr comparison (#575)
This may fix #565

It is not recommended to compare two structs via memcmp although they have been
memset to 0.
Added two helper functions to compare sockaddr_storage, one for address only and
the other one takes port into account.

These two functions are based on Unbound version in util/net_help.c, and
comform needs of shadowsocks-libev.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-04-08 17:26:11 -07:00
Syrone Wong 58264c77fc Polish code
code issues found by Clang with
CFLAGS="-Os -Wall -Wextra -Werror=unused-const-variable -Wno-error=unused-parameter"
enabled

The details as follows:
- variable initialization issue, modified them as Clang suggested
- data type mismatch when comparing, fix them either by casting or changing
  the data type of index of iterator
- get_sockaddr() in netutils may return -1 thus changed returning type from
  size_t to ssize_t, which makes Clang happier
- recvfrom() in udprelay is identical, fix this by creating local variable
  for comparison  and assign back to buf->len when returning value is acceptable

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-04-07 21:28:23 -07:00
Max Lv ce0561a999 Fix #560 2016-03-14 09:50:59 +08:00