<p></p>
<h3>Description</h3>
<p>When receiving packets from an ipv6 full length, $si is empty<br>
When  trying to listen to an ipv6 full length, kamailio refuses to start, trying to resolve the ipv6 instead of parsing it as an IPv6</p>
<p>There's no problem if the ipv6 in question is not maximum length.</p>
<h3>Troubleshooting</h3>
<p>It seems like ip_addr2a() fails to properly parse a 39b length ipv6.</p>
<h4>Reproduction</h4>
<p>reproduced easily by placing calls from an ipv6 containing no 0 or trying to listen to an ipv6 full length.</p>
<h4>Log Messages</h4>
<p>Example packet and log associated:</p>
<p>Aug 13 01:06:42 test-1 /usr/sbin/kamailio[25890]: DEBUG: tls [tls_server.c:477]: tls_accept(): tls_accept: new connection from :52524 using TLSv1.0 ECDHE-RSA-AES256-SHA 256</p>
<p>=> The empty string before the port in that log should be a 39chr long ipv6</p>
<p>Aug 13 01:06:42 test-1 /usr/sbin/kamailio[25890]: WARNING: [INVITE|FROM|TO|/[]:57677=>2600:aaaa:aaaa:aaaa:aa:aa:aa:146:443/tls/22] 610:Empty source ip ?!</p>
<p>=> That is a log generated from the config, which should be $si/$siz before the port 57677 and is empty. There's a test before that log line if ($si == "") { log }</p>
<h4>SIP Traffic ( Anonymized )</h4>
<p>INVITE sip:+TO@DOMAIN;transport=tls SIP/2.0<br>
Via: SIP/2.0/TLS [2607:bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:d5c1]:57677;branch=z9hG4bK.5SSv~9uQw;rport<br>
From: "FROM" sip:FROM@DOMAIN;tag=8sei4EB40<br>
To: "TO" sip:+TO@DOMAIN<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="52852064" data-permission-text="Title is private" data-url="https://github.com/kamailio/kamailio/issues/15" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/15/hovercard" href="https://github.com/kamailio/kamailio/issues/15">#15</a>#012CSeq: 20 INVITE<br>
Call-ID: mA5D5fcZdt#15#012Max-Forwards: 70<br>
Route: sip:DOMAIN:443;lr<br>
Supported: replaces, outbound<br>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE<br>
Content-Type: application/sdp<br>
Content-Length: 529<br>
Contact: sip:ua@[2607:bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:d5c1]:57677;transport=tls;+sip.instance="urn:uuid:2a1a2139-8ed6-40bd-9352-d804d331a098"<br>
User-Agent: UA</p>
<p>v=0<br>
o=#191026873 3487 1810 IN IP6 2607:bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:d5c1<br>
s=Talk<br>
c=IN IP6 2607:bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:d5c1<br>
b=AS:380<br>
t=0 0<br>
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics<br>
m=audio 10712 RTP/AVP 124 117 115 0 101 96 97<br>
a=rtpmap:124 opus/48000/2<br>
a=fmtp:124 useinbandfec=1<br>
a=rtpmap:117 SILK/16000<br>
a=rtpmap:115 SILK/8000<br>
a=rtpmap:101 telephone-event/48000<br>
a=rtpmap:96 telephone-event/16000<br>
a=rtpmap:97 telephone-event/8000<br>
a=rtcp-fb:* trr-int 1000<br>
a=rtcp-fb:* ccm tmmbr#15</p>
<h3>Possible Solutions</h3>
<p>Patching src/core/ip_addr.h to change IP6_MAX_STR_SIZE from 39 to 40 fix the issue.</p>
<h3>Additional Information</h3>
<p>version: kamailio 5.5.1 (x86_64/linux) ( commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/kamailio/kamailio/commit/5ecf17bc2d308141534bdaf3a312704daf0db850/hovercard" href="https://github.com/kamailio/kamailio/commit/5ecf17bc2d308141534bdaf3a312704daf0db850"><tt>5ecf17b</tt></a> )</p>
<ul>
<li><strong>Operating System</strong>:</li>
<li></li>
</ul>
<p>Debian 10.10</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2823">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZODUE3ZTVOSZPMTTDTT4SOIXANCNFSM5CC2MZXA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email">Android</a>.<img src="https://github.com/notifications/beacon/ABO7UZK232G2YK2BAKGSYNLT4SOIXA5CNFSM5CC2MZXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4OOR3MYA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2823",
"url": "https://github.com/kamailio/kamailio/issues/2823",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>