<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/22709">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ns2: Don't try to add packets to the backlog on real errors<br><br>When writing to the AF_PACKET socket, we have to distinguish the<br>pseudo-errors like -ENOBUFS (where we do want to add to the backlog)<br>from real errors like -ENETDOWN, -EMSGSIZE, ... where we don't want<br>to add the failed packet to the backlog.<br><br>Change-Id: Ibbb6805da0f118466c4c91e458e62b63b84cb794<br>---<br>M src/gb/gprs_ns2_fr.c<br>1 file changed, 5 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/09/22709/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c</span><br><span>index b2b3cde..8421691 100644</span><br><span>--- a/src/gb/gprs_ns2_fr.c</span><br><span>+++ b/src/gb/gprs_ns2_fr.c</span><br><span>@@ -311,10 +311,14 @@</span><br><span>              switch (errno) {</span><br><span>             case EAGAIN:</span><br><span>                 case ENOBUFS:</span><br><span style="color: hsl(120, 100%, 40%);">+                 /* not a real error, but more a normal event on AF_PACKET */</span><br><span style="color: hsl(120, 100%, 40%);">+                  /* don't free the message and let the caller re-enqueue */</span><br><span>                       return -errno;</span><br><span>               default:</span><br><span style="color: hsl(120, 100%, 40%);">+                      /* an actual error, like -ENETDOWN, -EMSGSIZE */</span><br><span>                     LOGBIND(bind, LOGL_ERROR, "error during write to AF_PACKET: %s\n", strerror(errno));</span><br><span style="color: hsl(0, 100%, 40%);">-                  return -errno;</span><br><span style="color: hsl(120, 100%, 40%);">+                        msgb_free(msg);</span><br><span style="color: hsl(120, 100%, 40%);">+                       return 0;</span><br><span>            }</span><br><span>    } else {</span><br><span>             /* short write */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/22709">change 22709</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/+/22709"/><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: Ibbb6805da0f118466c4c91e458e62b63b84cb794 </div>
<div style="display:none"> Gerrit-Change-Number: 22709 </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>