<p>tnt <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-netif/+/18097">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stream: Attempt to workaround kernel ABI breakage<br><br>See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/uapi/linux/sctp.h?id=b6e6b5f1da7e8d092f86a4351802c27c0170c5a5<br>and https://marc.info/?l=linux-sctp&m=158729301516157&w=2<br><br>A kernel structure changed size, a new field was added at the end.<br>Attempt to submit with the known "old" size.<br><br>Signed-off-by: Sylvain Munaut <tnt@246tNt.com><br>Change-Id: Ia95dd1f9ffed9f743c049e05797b1a6f1f9f8c69<br>---<br>M src/stream.c<br>1 file changed, 16 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/stream.c b/src/stream.c</span><br><span>index 65532d3..5887bf9 100644</span><br><span>--- a/src/stream.c</span><br><span>+++ b/src/stream.c</span><br><span>@@ -92,6 +92,22 @@</span><br><span>    rc = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS,</span><br><span>                       &event, sizeof(event));</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+       /*</span><br><span style="color: hsl(120, 100%, 40%);">+     * Attempt to work around kernel ABI breakage</span><br><span style="color: hsl(120, 100%, 40%);">+  *</span><br><span style="color: hsl(120, 100%, 40%);">+     * In kernel commit b6e6b5f1da7e8d092f86a4351802c27c0170c5a5, the</span><br><span style="color: hsl(120, 100%, 40%);">+      * struct sctp_event_subscribe had a u8 field added to it at the end, thus</span><br><span style="color: hsl(120, 100%, 40%);">+     * breaking ABI.</span><br><span style="color: hsl(120, 100%, 40%);">+       * See https://marc.info/?l=linux-sctp&m=158729301516157&w=2 for discussion.</span><br><span style="color: hsl(120, 100%, 40%);">+   *</span><br><span style="color: hsl(120, 100%, 40%);">+     * We attempt to work around the issue where the kernel header are new</span><br><span style="color: hsl(120, 100%, 40%);">+         * and running kernel is old, by forcing the size of the struct to 13 which</span><br><span style="color: hsl(120, 100%, 40%);">+    * is the "old" size</span><br><span style="color: hsl(120, 100%, 40%);">+         */</span><br><span style="color: hsl(120, 100%, 40%);">+   if ((rc < 0) && (sizeof(event) != 13))</span><br><span style="color: hsl(120, 100%, 40%);">+             rc = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS,</span><br><span style="color: hsl(120, 100%, 40%);">+                                &event, 13);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   if (rc < 0)</span><br><span>               LOGP(DLINP, LOGL_ERROR, "couldn't activate SCTP events "</span><br><span>                    "on FD %u\n", fd);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-netif/+/18097">change 18097</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmo-netif/+/18097"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-netif </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ia95dd1f9ffed9f743c049e05797b1a6f1f9f8c69 </div>
<div style="display:none"> Gerrit-Change-Number: 18097 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: tnt <tnt@246tNt.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: tnt <tnt@246tNt.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>