<p><a href="https://gerrit.osmocom.org/13608">View Change</a></p><p>5 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/13608/3//COMMIT_MSG">Commit Message:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13608/3//COMMIT_MSG@12">Patch Set #3, Line 12:</a> <code style="font-family:monospace,monospace">all, without actually checking any credentials database.</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">So the MS is expected to send inside PAP the values you configure your APN with? (the User+Password  […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">yes, if you add username/password, the MS/UE should send those values in PAP.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c">File ggsn/ggsn.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c@518">Patch Set #3, Line 518:</a> <code style="font-family:monospace,monospace">       unsigned int pap_welcome_len = strlen(pap_welcome);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">"ARRAY_SIZE(pap_welcome) -1" would make sense too :)</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think gcc is smart enough to do the strlen at compile-time these days. It's much more readable, for sure.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c@519">Patch Set #3, Line 519:</a> <code style="font-family:monospace,monospace">       uint8_t pap_out_size = sizeof(struct pap_element) + 1 + pap_welcome_len;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Is that +1 for the NULL chat of pap_welcome? please add comment (and add +1 to the end).</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">the one bytes is for the *length* byte. There is no requirement for NUL termination</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c@520">Patch Set #3, Line 520:</a> <code style="font-family:monospace,monospace">    struct pap_element *pap_out = alloca(pap_out_size);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">nice, didn't know about alloca()</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">you can also use runtime-computed size for arrays these days.  So something like having the length passed in as a function argument and then putting "char foo[len_arg];" on the stack works.  However, in this case we don't want to allocate an array but 'struct pcap_element' with some extra bytes at the end, and hence I went for alloca.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c@526">Patch Set #3, Line 526:</a> <code style="font-family:monospace,monospace">  if (htons(pap_in->len) > pco_in->length)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">is htons() fine alignment-access wise? […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">ACK, will update.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/13608">change 13608</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/13608"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ggsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731 </div>
<div style="display:none"> Gerrit-Change-Number: 13608 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 12 Apr 2019 10:21:45 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>