Article delegate-en/4356 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A4355@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: Few questions about transparent proxy & srcif
26 Jan 2009 08:04:03 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

In message <_A4355@delegate-en.ML_> on 01/26/09(16:25:01)
you Master NoSFeRaTU <peihqbdyi-ktwgyoxnbmlr.ml@ml.delegate.org> wrote:
 |>  SRCIF=_-DontRouteIfNotBound.10.1.1.1  ... set SO_DONTROUTE if not bound
 |Great, but enclosed patch don't work for me.
 |
 |SRCIF=_-DontRouteIfNotBound.192.168.77.11
 |
 |01/26 09:40:02.72 [67219] 1+1: REQUEST = (no-cache)[http://ya.ru:80/]
 |GET / HTTP/1.1^M
 |01/26 09:40:02.72 [67219] 1+1:
 |gethostbyname(_-DontRouteIfNotBound.192.168.77.11) unknown[0.00s]
 |01/26 09:40:02.72 [67219] 1+1: #### VSA_atosa() NULL ADDR
 |01/26 09:40:02.72 [67219] 1+1: bind_inet(14,255.255.255.255:0) failed:
 |ERRNO=49 (not a local port)

Thank you. It seems to happen when a specified host (address) is not
(inversely) resolvable.  I've started apllying the "_-prefix.host" to
multiple purposes to control outgoing connection (ex. timeout and retrying)
and gethostaddr() will be modified as the enclosed patch which will
also solve your case.

Cheers,
Yutaka
--
  9 9   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( ~ )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller


*** inets.c.orig	Mon Jan 26 16:48:57 2009
--- inets.c	Mon Jan 26 16:56:42 2009
***************
*** 2500,2505 ****
--- 2500,2511 ----
  }
  static const char *_gethostaddr(PCStr(host),int cache_only)
  {	struct hostent *hp;
+ 	const char *addr;
+ 
+ 	if( (addr = stripHostPrefix(host)) != host )
+ 	if( VSA_strisaddr(addr) ){
+ 		return addr;
+ 	}
  
  	if( VSA_strisaddr(host) )
  		return host;

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V