21 Commits
Author SHA1 Message Date
Max Lv b28638ab80 Clean up 2016-09-09 13:17:58 +08:00
Max Lv a3a51b8414 Refine hostname validation 2016-09-06 09:01:51 +08:00
Max Lv bf194fef75 Add validation of domain name 2016-08-31 09:45:47 +08:00
tim-le ad17d91b42 fix bugs with when ss-server bind_address enabled (#725)
* SO_REUSEADDR for remote sockfd

avoid  ERROR: bind_to_address: Address already in use

* set addr->sin_port to be 0
2016-07-14 18:08:10 -05:00
Max Lv 55dea8b973 Fix #690 2016-06-28 15:33:55 +08:00
Max Lv fd4adca789 Fix #627 2016-05-06 15:36:37 +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
Kim 08f873adc7 Roll up year to 2016 2016-04-22 22:50:26 +08:00
Max Lv 114128668c Refine helper functions 2016-04-16 00:43:27 +08: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 e921f40aa8 Fix #493 2015-12-25 09:18:53 +08:00
Max Lv b0600a8784 Refine buffer handling 2015-11-30 15:03:04 +08:00
Max Lv 248abd3d02 clean up 2015-05-10 20:45:23 +08:00
Max Lv 9431b9b0c3 Add TPROXY support for redir mode 2015-05-05 14:37:27 +08:00
Max Lv 339372af39 fix #277 2015-03-06 09:25:45 +08:00
Max Lv b875797839 clean up 2015-03-05 14:16:28 +08:00
Max Lv 726a1b7dd7 clean up 2015-01-22 09:12:19 +08:00
Max Lv ba889d277d fix #227 2015-01-15 15:26:46 +09:00
Max Lv 40e9be0021 Avoid getaddrinfo() in the main loop 2015-01-12 16:49:47 +09:00