[sr-dev] Patch: Fix SRV lookups when dns failover is enabled

Øyvind Kolbu oyvind.kolbu at usit.uio.no
Fri Oct 18 10:01:51 CEST 2013


On 17.10.2013 19:09, Daniel-Constantin Mierla wrote:
> looking at the first patch, I see that PROTO_NONE was removed from those
> switch statements on proto variables. I guess it was the reason of the
> issue, as you pointed it out, that a non-existing udp srv records
> results in failure. Isn't it?

No, the reason was that it can never be true, as just before *proto is
set to PROTO_UDP if not set.

         if (proto){ /* makes sure we have a protocol set*/
                 if (*proto==0)
                         *proto=srv_proto=PROTO_UDP; /* default */
                 else
                         srv_proto=*proto;
         }else{
                 srv_proto=PROTO_UDP;
         }

The problem with the old code was that, unless you specified a
protocol, it would only attempt to search up _sip._udp and not
continue with _sip._tcp and possible other protocols.

> To be sure I got properly the new logic, if proto var is PROTO_NONE,
> then create_srv_pref_list(..) will build a list of protocols to try
> based on config preferences. The it will be a dns lookup of the values
> in the list. Right?

Yes, if the original *proto is PROTO_NONE, then call
create_srv_pref_list and then stop on the first match in the
generated list.

-- 
Øyvind



More information about the sr-dev mailing list