< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] Enum crashing repro


On 01/08/12 22:05, Daniel Pocock wrote:
> 
> 
> I put this in my config, it is actually wrong (should be
> e164-addr.sip5060.net):
> 
>   EnumSuffixes = e164.arpa, sip5060.net
> 
> and when the repro receives a request such as
> 
>   sip:+123456789@xxxxxxxxxxxxxxxxxxxxx
> 
> it appears to do two things wrong:
> 
> a) even though it is for some.other.domain.com, it still goes into the
> ENUM logic

Looking at the full log, I dug up the sequence of events leading to an
ENUM lookup attempt (see further down)

It appears the only attempt to decide if a URI should be routed by ENUM
result is the call to uri.isEnumSearchable().  That method only checks
if the user portion of the URI begins with a `+'.

Proposed changes:

a) isEnumSearchable() needs to make sure the characters following the
`+' are digits (to be precise, up to 15 digits as per E.164)

b) somewhere we need to decide if ENUM must be applied.
- Maybe a new config param, EnumDomains, and ENUM logic is only used if
the Uri domain is in EnumDomains
- maybe a Uri parameter can also be used, e.g.
       sip:+41xxx@xxxxxxxxxxxxxxx?reproEnum
- which method should have this new logic?  Maybe DnsResult::lookup(),
because that is where mDoingEnum is set true/false

Would these changes disturb anyone if implemented for the next 1.8.x
release?  It would preferably be done without changing the method
prototypes.

TransportSelector.cxx:454 | Looking up dns entries for
sip:+41xxxxx@xxxxxxxxxxxxxxxxxxxxx

  mDns.lookup(result, msg->const_header(h_RequestLine).uri());

DnsInterface.cxx:
   void DnsInterface::lookup(DnsResult* res, const Uri& uri) {
      res->lookup(uri, mDnsStub.getEnumSuffixes());
   }

DnsResult.cxx:203 | DnsResult::lookup sip:+41xxxxx@xxxxxxxxxxxxxxxxxxxxx

   uri.isEnumSearchable()
   ...
   std::vector<Data> enums = uri.getEnumLookups(enumSuffixes);

(by co-incidence, some.other.domain.com is actually one of my
EnumSuffixes, but it is irrelevant here)





> 
> b) it crashes
> 
> DEBUG | 20120801-234840.323 | repro | RESIP:DNS | 139927527098112 |
> DnsResult.cxx:203 | DnsResult::lookup sip:+41xxxxxxx@xxxxxxxxxxx
> repro: DnsResult.cxx:210: void resip::DnsResult::lookup(const
> resip::Uri&, const std::vector<resip::Data>&): Assertion `enums.size()
> <= 1' failed.
> 

Looking more closely in DnsResult.cxx, this function appears to return 1
entry for every suffix:

      std::vector<Data> enums = uri.getEnumLookups(enumSuffixes);

so the next line:

      assert(enums.size() <= 1);

is guaranteed to fail if multiple suffixes are specified.


> 
> 
> I corrected the EnumSuffixes config, now it is
> 
>   EnumSuffixes = e164.arpa, e164-addr.sip5060.net
> 
> but the same assert/crash still occurs
> 
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxx
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel