From: Ján Tomko Date: Tue, 1 Sep 2020 20:56:37 +0000 (+0200) Subject: util: virnetdevtap: stats: fix txdrop on FreeBSD X-Git-Tag: v6.8.0-rc1~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebbf8ebe4fa6f9d43b40673f0f2dad6bf50e2085;p=thirdparty%2Flibvirt.git util: virnetdevtap: stats: fix txdrop on FreeBSD For older FreeBSD, we needed an ifdef guard to use if_data.ifi_oqdrops, which was introduced by: commit 61bbdbb94ce3e2f5e969c9bddb443427db07bf61 Implement interface stats for BSD But when we dropped the check because we deprecated building on FreeBSD-10 in: commit 83131d9714db7ee77ab220186b6b0d8b6c22b09e configure: drop check for unsupported FreeBSD We started building the wrong side of the ifdef. Signed-off-by: Ján Tomko Fixes: 83131d9714db7ee77ab220186b6b0d8b6c22b09e Reviewed-by: Roman Bogorodskiy --- diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 6c87c7e2ef..cc6f254aa1 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -974,20 +974,12 @@ virNetDevTapInterfaceStats(const char *ifname, stats->rx_bytes = ifd->ifi_obytes; stats->rx_packets = ifd->ifi_opackets; stats->rx_errs = ifd->ifi_oerrors; -# ifdef HAVE_STRUCT_IF_DATA_IFI_OQDROPS stats->rx_drop = ifd->ifi_oqdrops; -# else - stats->rx_drop = 0; -# endif } else { stats->tx_bytes = ifd->ifi_obytes; stats->tx_packets = ifd->ifi_opackets; stats->tx_errs = ifd->ifi_oerrors; -# ifdef HAVE_STRUCT_IF_DATA_IFI_OQDROPS stats->tx_drop = ifd->ifi_oqdrops; -# else - stats->tx_drop = 0; -# endif stats->rx_bytes = ifd->ifi_ibytes; stats->rx_packets = ifd->ifi_ipackets; stats->rx_errs = ifd->ifi_ierrors;