]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: virnetdevtap: stats: fix txdrop on FreeBSD
authorJán Tomko <jtomko@redhat.com>
Tue, 1 Sep 2020 20:56:37 +0000 (22:56 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 3 Sep 2020 18:25:07 +0000 (20:25 +0200)
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 <jtomko@redhat.com>
Fixes: 83131d9714db7ee77ab220186b6b0d8b6c22b09e
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
src/util/virnetdevtap.c

index 6c87c7e2ef5325492ca6c87cf9add5fbf5623b30..cc6f254aa1a7d8932da852ba0c9d5a85856553bd 100644 (file)
@@ -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;