[sr-dev] doubt about from_gw() with proto=ANY

Juha Heinanen jh at tutpro.com
Tue Jul 3 14:34:26 CEST 2012


Andrew Pogrebennyk writes:

> 0 = ANY so it should match gateway with this IP address no matter what
> the transport is.

looks like ANY is not currently supported in the code.

> But in reality that's not what the lcr_mod.c does:
> 
>      if ((res != NULL) &&
>  	((res->transport == transport) ||
>  	 ((res->transport == PROTO_NONE) && (transport == PROTO_UDP)))) {

you could try to change the above to this:

      if ((res != NULL) &&
  	((transport == PROTO_NONE) || (res->transport == transport))) {

> And what is the last check for: (res->transport == PROTO_NONE) &&
> (transport == PROTO_UDP) ?

looks like it is old code from the time when PROTO_NONE didn't mean ANY,
but that transport protocol was not defined, in which case it defaulted
to UDP.

i'm not personally using these test functions anymore, since i consider htable
based solution a better alternative.

-- juha





More information about the sr-dev mailing list