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

Re: [reSIProcate] ipv6 and maddr


Thank Bjorn!  I have committed this fix.

Scott


On Mon, Jun 9, 2014 at 11:06 AM, Björn Andersson <bjorn.andersson@xxxxxxxxxx> wrote:
We are trying to run ipv6 towards Lync, and we get a contact in a
reliable provisional like this:
Contact: <sip:lync-2013-se2.aas.rnd.se.aastra.com:5068;transport=Tcp;maddr=[fde3:c7e4:2164:66:20dc:ef02:ce6f:85be]

when sending prack the dns resolving will not discover that target is an ip address because of the brackets:
Looking up dns entries for sip:lync-2013-se2.aas.rnd.se.aastra.com:5068;transport=Tcp;maddr=[fde3:c7e4:2164:66:20dc:ef02:ce6f:85be]

Following patch fixes the problem for us, but maybe there is a better solution:

*** DnsResult.cxx.orig  2014-06-09 16:53:38.741342891 +0200
--- DnsResult.cxx       2014-06-09 16:58:02.573343675 +0200
*************** DnsResult::lookupInternal(const Uri& uri
*** 279,284 ****
--- 279,289 ----
     //assert(uri.scheme() == Symbols::Sips || uri.scheme() == Symbols::Sip);
     mSips = (uri.scheme() == Symbols::Sips);
     mTarget = (!mSips && uri.exists(p_maddr)) ? uri.param(p_maddr) : uri.host();
+    // remove brackets around ipv6 address if present
+    if (mTarget[0] == '[' && mTarget[mTarget.size()-1] == ']')
+    {
+       mTarget = mTarget.substr(1,mTarget.size()-2);
+    }
     mSrvKey = Symbols::UNDERSCORE + uri.scheme().substr(0, uri.scheme().size()) + Symbols::DOT;
     bool isNumeric = DnsUtil::isIpAddress(mTarget);


Cheers
Björn A.

_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel