<p style="white-space: pre-wrap; word-wrap: break-word;">This change is ready for review.</p><p><a href="https://gerrit.osmocom.org/12763">View Change</a></p><p>13 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c">File src/osysmon_openvpn.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/12763/5/src/osysmon_openvpn.c@68">Patch Set #5, Line 68:</a> <code style="font-family:monospace,monospace"></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">get_authority memleak,</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@74">Patch Set #5, Line 74:</a> <code style="font-family:monospace,monospace">                      return NULL;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">get_authority memleak.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@79">Patch Set #5, Line 79:</a> <code style="font-family:monospace,monospace"></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">if that's a string, then you can simply use osmo_strlcpy afaik.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@82">Patch Set #5, Line 82:</a> <code style="font-family:monospace,monospace"> for (tok = strtok(tmp, ","); tok && i < MAX_RESP_COMPONENTS; tok = strtok(NULL, ",")) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">add missing {}, otherwise it's confusing. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@83">Patch Set #5, Line 83:</a> <code style="font-family:monospace,monospace">          /* The string format is documented in https://openvpn.net/community-resources/management-interface/ */</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">if I understand correctly, first time switch is checked against i=0 (because it's incremented afterw […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@127">Patch Set #5, Line 127:</a> <code style="font-family:monospace,monospace">{</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">(!msg)</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@134">Patch Set #5, Line 134:</a> <code style="font-family:monospace,monospace">       }</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">mem leak, get_authority allocates stuff. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@149">Patch Set #5, Line 149:</a> <code style="font-family:monospace,monospace">  struct openvpn_client *vpn = openvpn_client_find_or_make(os, host, port);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">that's weird from API point of view. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@159">Patch Set #5, Line 159:</a> <code style="font-family:monospace,monospace">  vpn->cfg = host_cfg_alloc(vpn, name, host, port);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Instead of talloc_free + return false in lots of places, use a goto to end of function.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@178">Patch Set #5, Line 178:</a> <code style="font-family:monospace,monospace">      if (osmo_stream_cli_open(vpn->mgmt) < 0) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">was this already fixed? otherwise please open a ticket and put the ticket number in the commit for l […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">libosmo-netif patches are under review ATM</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@263">Patch Set #5, Line 263:</a> <code style="font-family:monospace,monospace"></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">possible memleak of remote later on, to be checked.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">What makes you think that? It should be automatically cleaned by talloc on vty refresh.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@267">Patch Set #5, Line 267:</a> <code style="font-family:monospace,monospace">            osmo_stream_cli_send(vpn->mgmt, msg);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Not sure what is this for.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Not what you're referring to:</p><ul><li>msgb_printf is to print stuff into msgb, documented in libosmocore</li><li>osmo_stream_cli_send is to send msgb, documented in libosmo-netif</li></ul></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12763/5/src/osysmon_openvpn.c@287">Patch Set #5, Line 287:</a> <code style="font-family:monospace,monospace">                struct value_node *vn_vpn = value_node_add(parent, "OpenVPN", NULL);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">No need to count, just check if the list is not empty.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/12763">change 12763</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/12763"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sysmon </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I4493e19b9a09dcebd289457eacd1719f7f8cc31c </div>
<div style="display:none"> Gerrit-Change-Number: 12763 </div>
<div style="display:none"> Gerrit-PatchSet: 7 </div>
<div style="display:none"> Gerrit-Owner: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 07 Feb 2019 16:45:30 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>