<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/26683">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">tcp_stats: fix compilation on CentOS 7<br><br>This is to fix the following compile error on CentOS 7:<br><br>[   74s] stats_tcp.c: In function 'fill_stats':<br>[   74s] stats_tcp.c:138:15: error: 'struct tcp_info' has no member named 'tcpi_notsent_bytes'<br>[   74s]        tcp_info.tcpi_notsent_bytes);<br>[   74s]                ^<br><br>Closes: OS#5374<br>Change-Id: Icde6651baeb0828477dbf540a02b16a1a5f91797<br>---<br>M configure.ac<br>M src/stats_tcp.c<br>2 files changed, 11 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/26683/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configure.ac b/configure.ac</span><br><span>index 8fb299b..89615fd 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -517,6 +517,13 @@</span><br><span>   [Runtime SIMD detection will be disabled])</span><br><span> </span><br><span> dnl There are some members in struct tcp_info that might not exist on all linux versions</span><br><span style="color: hsl(120, 100%, 40%);">+AC_CHECK_MEMBER([struct tcp_info.tcpi_notsent_bytes],</span><br><span style="color: hsl(120, 100%, 40%);">+                AC_DEFINE([HAVE_TCP_INFO_TCPI_NOTSENT_BYTES],</span><br><span style="color: hsl(120, 100%, 40%);">+         [1],</span><br><span style="color: hsl(120, 100%, 40%);">+          [Define to 1 if your <linux/tcp.h> header file have the tcpi_notsent_bytes member in struct tcp_info]),</span><br><span style="color: hsl(120, 100%, 40%);">+         [],</span><br><span style="color: hsl(120, 100%, 40%);">+           [#include <linux/tcp.h>])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> AC_CHECK_MEMBER([struct tcp_info.tcpi_rwnd_limited],</span><br><span>            AC_DEFINE([HAVE_TCP_INFO_TCPI_RWND_LIMITED],</span><br><span>                 [1],</span><br><span>diff --git a/src/stats_tcp.c b/src/stats_tcp.c</span><br><span>index fffb10a..d2be6a9 100644</span><br><span>--- a/src/stats_tcp.c</span><br><span>+++ b/src/stats_tcp.c</span><br><span>@@ -134,8 +134,12 @@</span><br><span>         osmo_stat_item_set(osmo_stat_item_group_get_item(stats_tcp_entry->stats_tcp, STATS_TCP_RTT), tcp_info.tcpi_rtt);</span><br><span>  osmo_stat_item_set(osmo_stat_item_group_get_item(stats_tcp_entry->stats_tcp, STATS_TCP_RCV_RTT),</span><br><span>                     tcp_info.tcpi_rcv_rtt);</span><br><span style="color: hsl(120, 100%, 40%);">+#if HAVE_TCP_INFO_TCPI_NOTSENT_BYTES == 1</span><br><span>        osmo_stat_item_set(osmo_stat_item_group_get_item(stats_tcp_entry->stats_tcp, STATS_TCP_NOTSENT_BYTES),</span><br><span>                       tcp_info.tcpi_notsent_bytes);</span><br><span style="color: hsl(120, 100%, 40%);">+#else</span><br><span style="color: hsl(120, 100%, 40%);">+       osmo_stat_item_set(osmo_stat_item_group_get_item(stats_tcp_entry->stats_tcp, STATS_TCP_NOTSENT_BYTES), -1);</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span> </span><br><span> #if HAVE_TCP_INFO_TCPI_RWND_LIMITED == 1</span><br><span>       osmo_stat_item_set(osmo_stat_item_group_get_item(stats_tcp_entry->stats_tcp, STATS_TCP_RWND_LIMITED),</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/26683">change 26683</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/+/26683"/><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: Icde6651baeb0828477dbf540a02b16a1a5f91797 </div>
<div style="display:none"> Gerrit-Change-Number: 26683 </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>