<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/19128">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">lapd_core: Ensure we always have some tailroom<br><br>At some points, e.g. when allocating message buffers from the Tx<br>history, we used to allocate them exactly as large as the defined<br>headroom plus the user data.  This means that the underlying PH layer<br>(E1 mostly) had no tailroom to add anything to the end of the message.<br><br>Especially for DAHDI this is a problem, as we need to make space for<br>two more bytes of frame check sequence (FCS).<br><br>So let's simply make sure we always have some extra space at the end<br>of such buffers.<br><br>Change-Id: Id362ce131157c7513d744b0248c7f78fb75c590c<br>Related: OS#4644<br>---<br>M src/gsm/lapd_core.c<br>1 file changed, 2 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/19128/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c</span><br><span>index c77b663..cf25f3d 100644</span><br><span>--- a/src/gsm/lapd_core.c</span><br><span>+++ b/src/gsm/lapd_core.c</span><br><span>@@ -104,6 +104,7 @@</span><br><span> #define CR_NET2USER_RESP     0</span><br><span> </span><br><span> #define LAPD_HEADROOM  56</span><br><span style="color: hsl(120, 100%, 40%);">+#define LAPD_TAILROOM       16</span><br><span> </span><br><span> #define SBIT(a) (1 << a)</span><br><span> #define ALL_STATES 0xffffffff</span><br><span>@@ -120,7 +121,7 @@</span><br><span>      /* adding space for padding, FIXME: add as an option */</span><br><span>      if (length < 21)</span><br><span>          length = 21;</span><br><span style="color: hsl(0, 100%, 40%);">-    return msgb_alloc_headroom(length + LAPD_HEADROOM, LAPD_HEADROOM, name);</span><br><span style="color: hsl(120, 100%, 40%);">+      return msgb_alloc_headroom(length + LAPD_HEADROOM + LAPD_TAILROOM, LAPD_HEADROOM, name);</span><br><span> }</span><br><span> </span><br><span> static inline uint8_t do_mod(uint8_t x, uint8_t m)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/19128">change 19128</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/libosmocore/+/19128"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Id362ce131157c7513d744b0248c7f78fb75c590c </div>
<div style="display:none"> Gerrit-Change-Number: 19128 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>