<p>pespin <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17618">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pdch: fix packet_paging_request(): properly print paging MI<br><br>This problem problem was discovered by the Undefined Behavior Sanitizer:<br><br>  pdch.cpp:210:4: runtime error: load of misaligned address<br>                  0x60c00002abf2 for type 'uint32_t',<br>                  which requires 4 byte alignment<br><br>Do not convert TMSI to number, use osmo_mi_name() from libosmocore.<br>Also use this function to print other MI types (IMSI or IMEISV).<br><br>Change-Id: Icf8836f216793e342b239c8e6645aac1e82bf324<br>---<br>M src/pdch.cpp<br>1 file changed, 4 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/pdch.cpp b/src/pdch.cpp</span><br><span>index 519028d..9910974 100644</span><br><span>--- a/src/pdch.cpp</span><br><span>+++ b/src/pdch.cpp</span><br><span>@@ -39,6 +39,7 @@</span><br><span> extern "C" {</span><br><span> #include <osmocom/core/talloc.h></span><br><span> #include <osmocom/core/msgb.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/gsm/gsm48.h></span><br><span> #include <osmocom/gsm/protocol/gsm_04_08.h></span><br><span> #include <osmocom/core/bitvec.h></span><br><span> #include <osmocom/core/gsmtap.h></span><br><span>@@ -204,11 +205,12 @@</span><br><span> </span><br><span>     /* loop until message is full */</span><br><span>     while (pag) {</span><br><span style="color: hsl(120, 100%, 40%);">+         LOGP(DRLCMAC, LOGL_DEBUG, "Paging MI - %s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                    osmo_mi_name(pag->identity_lv + 1, pag->identity_lv[0]));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>               /* try to add paging */</span><br><span>              if ((pag->identity_lv[1] & 0x07) == 4) {</span><br><span>                      /* TMSI */</span><br><span style="color: hsl(0, 100%, 40%);">-                      LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                          ntohl(*((uint32_t *)(pag->identity_lv + 1))));</span><br><span>                    len = 1 + 1 + 1 + 32 + 2 + 1;</span><br><span>                        if (pag->identity_lv[0] != 5) {</span><br><span>                           LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with "</span><br><span>@@ -217,9 +219,6 @@</span><br><span>                        }</span><br><span>            } else {</span><br><span>                     /* MI */</span><br><span style="color: hsl(0, 100%, 40%);">-                        LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                                osmo_hexdump(pag->identity_lv + 1,</span><br><span style="color: hsl(0, 100%, 40%);">-                                   pag->identity_lv[0]));</span><br><span>                    len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1;</span><br><span>                     if (pag->identity_lv[0] > 8) {</span><br><span>                                 LOGP(DRLCMAC, LOGL_ERROR, "Paging with "</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17618">change 17618</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/osmo-pcu/+/17618"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Icf8836f216793e342b239c8e6645aac1e82bf324 </div>
<div style="display:none"> Gerrit-Change-Number: 17618 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>