<h4 dir="auto">Pre-Submission Checklist</h4>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commit message has the format required by CONTRIBUTING guide</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commits are split per component (core, individual modules, libs, utils, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Each component has a single commit (if not, squash them into one commit)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> No commits to README files for modules (changes must be done to docbook files<br>
in <code class="notranslate">doc/</code> subfolder, the README file is autogenerated)</li>
</ul>
<h4 dir="auto">Type Of Change</h4>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Small bug fix (non-breaking change which fixes an issue)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> New feature (non-breaking change which adds new functionality)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Breaking change (fix or feature that would change existing functionality)</li>
</ul>
<h4 dir="auto">Checklist:</h4>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> PR should be backported to stable branches (no, it is a requirement to use UDP/IPv6 with everyone)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Tested changes locally (same results as before with the Kamailio test framework)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Related to issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1242775488" data-permission-text="Title is private" data-url="https://github.com/kamailio/kamailio/issues/3119" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/3119/hovercard" href="https://github.com/kamailio/kamailio/issues/3119">#3119</a></li>
</ul>
<h4 dir="auto">Description</h4>
<p dir="auto">The IPv6 support for Path MTU discovery is absent, but IPv6 has no DF flag to allow downstream fragmentation.  See Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1242775488" data-permission-text="Title is private" data-url="https://github.com/kamailio/kamailio/issues/3119" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/3119/hovercard" href="https://github.com/kamailio/kamailio/issues/3119">#3119</a> for my discovery / learning path.  In short, unconnected UDP sockets do not learn Path MTU problems, so a message dropped once will be dropped again on resend.  Using <code class="notranslate">IPV6_PMTUDISC_WANT</code>, any knowledge in the kernel can be used to fragment the message at sending time, as intended for IPv6.</p>
<p dir="auto">These patches actually correct two IPv6-related things in the <code class="notranslate">core/udp_server.c</code>,</p>
<ol dir="auto">
<li>Benefit from any kernel knowledge about Path MTU for IPv6</li>
<li>The same option to learn from UDP_ERRORS is now available for IPv6</li>
</ol>
<p dir="auto">Do note that the last has not been implemented for IPv4 or IPv6.  It is more useful for IPv6, allowing instant "tm" resends for Path MTU, but not "sl" I think.  I cannot do that work, but this brings IPv6 to the same level as IPv4.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="commit 0f90cff05c1a448eb2f85f83b4c087ab32ede11
Author: Rick van Rein <rick@openfortress.nl>
Date:   Sat Jun 11 10:57:32 2022 +0000

    core: Issue 3119.  Handling ICMPv6 Packet too Big
    
    - This was only defined for IPv4 under flag UDP_ERRORS
    - IPv6 has no toggle DF to clear for en-route fragmentation
    - Kamailio currently does not collect with recvmsg(...,MSG_ERRQUEUE)
    - The benefits of adding that can be instant resends for "tm" messages
    - Note that "sl" messages will have been forgotten at this point

commit 6b404b5f9807174177bee36eaf3543be0794f55e
Author: Rick van Rein <rick@openfortress.nl>
Date:   Sat Jun 11 10:44:27 2022 +0000

    core: Issue #3119.  Path MTU kernel info for IPv6
    
    - For IPv4, DF is an option; for IPv6 it is always active
    - This makes pmtu_discover an IPv4-only option
    - This means that we should set IPV6_MTU_DISCOVER to IPV6_PMTUDISC_WANT
    - Unconnected UDP sockets can now learn from ICMPv6 "Packet too Big"
    - As a result, hitting a Path MTU upper bound is a learning process
    - This should stop consistent SIP packet drops due to Path MTU"><pre class="notranslate"><code>commit 0f90cff05c1a448eb2f85f83b4c087ab32ede11
Author: Rick van Rein <rick@openfortress.nl>
Date:   Sat Jun 11 10:57:32 2022 +0000

    core: Issue 3119.  Handling ICMPv6 Packet too Big
    
    - This was only defined for IPv4 under flag UDP_ERRORS
    - IPv6 has no toggle DF to clear for en-route fragmentation
    - Kamailio currently does not collect with recvmsg(...,MSG_ERRQUEUE)
    - The benefits of adding that can be instant resends for "tm" messages
    - Note that "sl" messages will have been forgotten at this point

commit 6b404b5f9807174177bee36eaf3543be0794f55e
Author: Rick van Rein <rick@openfortress.nl>
Date:   Sat Jun 11 10:44:27 2022 +0000

    core: Issue #3119.  Path MTU kernel info for IPv6
    
    - For IPv4, DF is an option; for IPv6 it is always active
    - This makes pmtu_discover an IPv4-only option
    - This means that we should set IPV6_MTU_DISCOVER to IPV6_PMTUDISC_WANT
    - Unconnected UDP sockets can now learn from ICMPv6 "Packet too Big"
    - As a result, hitting a Path MTU upper bound is a learning process
    - This should stop consistent SIP packet drops due to Path MTU
</code></pre></div>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/kamailio/kamailio/pull/3141'>https://github.com/kamailio/kamailio/pull/3141</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/kamailio/kamailio/pull/3141/commits/6b404b5f9807174177bee36eaf3543be0794f55e" class="commit-link">6b404b5</a>  core: Issue #3119.  Path MTU kernel info for IPv6</li>
  <li><a href="https://github.com/kamailio/kamailio/pull/3141/commits/0f90cff05c1a448eb2f85f83b4c087ab32ede112" class="commit-link">0f90cff</a>  core: Issue 3119.  Handling ICMPv6 Packet too Big</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/kamailio/kamailio/pull/3141/files">2 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/3141/files#diff-2cb9af06943be7083f74078ec426d48332b2ebb512b76117ed4992f183601d34">doc/misc/NEWS</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/3141/files#diff-2b22a49e7aa6037f5c2528d5c8fafed9e6710cff0cd195472f86f2036ec0b33a">src/core/udp_server.c</a>
    (44)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/3141.patch'>https://github.com/kamailio/kamailio/pull/3141.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/3141.diff'>https://github.com/kamailio/kamailio/pull/3141.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/3141">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZPNE2EI6GE7BDFTK7TVOR2SFANCNFSM5YP6JGMA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZKRMNKTFTP56NQFK3DVOR2SFA5CNFSM5YP6JGMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4S4X2VXA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/pull/3141</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/3141",
"url": "https://github.com/kamailio/kamailio/pull/3141",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>