0
0
mirror of https://github.com/darkk/redsocks.git synced 2025-08-25 19:25:30 +00:00
Commit Graph

13 Commits

Author SHA1 Message Date
Leonid Evdokimov
14ff78dfe7 Replace inconsistent rand()/random() with call to libevent2 rng 2016-03-09 01:12:38 +03:00
Leonid Evdokimov
18e2b5ed1f Fix compilation on Ubuntu 10.04 LTS and (hopefully) Debian squeeze[1]
fixes #28, fixes #22, fixes #24
[1] current "stable" release
2012-09-12 02:05:39 +04:00
Cody Schafer
b60b492602 Fix transposition of memset parameters. 2012-04-24 04:33:13 -05:00
Leonid Evdokimov
709646d59d Initial support for UDP + TPROXY redirection. No more dest_ip in redudp.
* TPROXY requires Linux 2.6.29+ (see man 7 ip[1]).
 * all redsocks code is running as root to bind to arbitrary port.
 * Non-Linux and old-Linux builds are broken at the moment.

[1] http://www.kernel.org/doc/man-pages/online/pages/man7/ip.7.html
2012-04-13 02:06:02 +04:00
Leonid Evdokimov
6015b3a6f2 inet_ntop -> red_inet_ntop 2012-04-10 01:43:22 +04:00
Leonid Evdokimov
4d2e10df17 Implement better exponential backoff in case of accept() failure.
This commit implements two more features:
 * min_accept_backoff configuration option
 * retry accept() after some close() calls

See also https://github.com/darkk/redsocks/issues/19
2012-03-25 23:58:40 +04:00
Bin Jin
dcbdcae943 Libevent2 fix: bad default line-extracting strategy
Libevent 2 deprecates evbuffer_readline() function, where any sequence
of any number of carriage return and linefeed characters is treated like
end of line, and introduces better evbuffer_readln(), where termination
format can be explicitly set to: \n, [\r]\n, \r\n or already mentioned
old behaviour.

Change past evbuffer_readline() calls to new
redsocks_evbuffer_readline() function. If libevent 2 is present, use
there evbuffer_readln() with eol_style set to an optional carriage
return, followed by a linefeed (EVBUFFER_EOL_CRLF) instead of obsolete
evbuffer_readln().

  Important note:
Consuming all CR and LF characters in one go (behaviour of
evbuffer_readline(), nowadays aliasing to evbuffer_readln() with
eol_style set to EVBUFFER_EOL_ANY) hangs up parsing of HTTP request
header ending with "\r\n\r\n", because it misses the empty line.

Conflicts (resolved):

	utils.c
	utils.h
2011-11-27 03:54:23 +04:00
Leonid Evdokimov
2f00cf44c5 Added dnstc service that serves any UDP DNS-like request with TC flag.
TC flag means `truncated`, so it actually means "ask me via TCP" for
compliant resolver.
2011-09-22 03:25:26 +04:00
Leonid Evdokimov
79e22a67fa Change license to Apache 2.0 to ensure compatibility with android stack. 2011-04-20 20:17:09 +03:00
Leonid Evdokimov
9bcb4dcc7e Fix compilation at OpenBSD 4.9. 2011-02-10 00:02:05 +02:00
Przemyslaw Pawelczyk
91da237590 getsockopt wants optlen to be socklen_t.
Remove warning regarding optlen being size_t.

BTW:
- size_t is at least 16-bit unsigned integral type,
- socklen_t is at least 32-bit signed integral type.
It obviously doesn't matter here, because sizeof(int) fits in 4 bits.
2011-01-27 22:14:58 +01:00
Leonid Evdokimov
8ad8d7eb41 More source code cleanup. 2010-11-27 23:20:46 +02:00
Leonid Evdokimov
c50dd8b2b4 Some source code cleanup. 2010-11-27 21:57:43 +02:00