New package redir
This patch adds a new package "redir" that allows to redirect incoming TCP connections to a specific destination in a proxy-like way. git-svn-id: svn://svn.openwrt.org/openwrt/packages@15686 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
38
net/redir/patches/04_fix_timeouts.patch
Normal file
38
net/redir/patches/04_fix_timeouts.patch
Normal file
@ -0,0 +1,38 @@
|
||||
diff -Nur a/redir.c b/redir.c
|
||||
--- a/redir.c 2005-10-22 22:44:39.504061784 -0400
|
||||
+++ b/redir.c 2005-10-22 22:47:14.746461352 -0400
|
||||
@@ -598,10 +598,6 @@
|
||||
/* Record start time */
|
||||
start_time = (unsigned int) time(NULL);
|
||||
|
||||
- /* Set up timeout */
|
||||
- timeout.tv_sec = timeout_secs;
|
||||
- timeout.tv_usec = 0;
|
||||
-
|
||||
/* file descriptor bits */
|
||||
FD_ZERO(&iofds);
|
||||
FD_SET(insock, &iofds);
|
||||
@@ -618,14 +614,21 @@
|
||||
while(1) {
|
||||
(void) memcpy(&c_iofds, &iofds, sizeof(iofds));
|
||||
|
||||
+ /* Set up timeout, Linux returns seconds left in this structure
|
||||
+ * so we have to reset it before each select(). */
|
||||
+ timeout.tv_sec = timeout_secs;
|
||||
+ timeout.tv_usec = 0;
|
||||
+
|
||||
|
||||
if (select(max_fd + 1,
|
||||
&c_iofds,
|
||||
(fd_set *)0,
|
||||
(fd_set *)0,
|
||||
(timeout_secs ? &timeout : NULL)) <= 0) {
|
||||
- /* syslog(LLEV,"connection timeout: %d sec",timeout.tv_sec);*/
|
||||
- break;
|
||||
+ if (dosyslog) {
|
||||
+ syslog(LOG_NOTICE,"connection timeout: %d sec",timeout_secs);
|
||||
+ }
|
||||
+ break;
|
||||
}
|
||||
|
||||
if(FD_ISSET(insock, &c_iofds)) {
|
Reference in New Issue
Block a user