NetIO (BSD): add txDrops detection if supported

This commit is contained in:
李通洲
2024-11-15 14:48:17 +08:00
parent 56eb8b80c6
commit 9f314a208b
3 changed files with 13 additions and 4 deletions
+2 -4
View File
@@ -1,8 +1,6 @@
#include "netio.h"
#include "common/io/io.h"
#include "common/netif/netif.h"
#include "util/stringUtils.h"
#include "util/mallocHelper.h"
#include <net/if.h>
@@ -48,8 +46,8 @@ const char* ffNetIOGetIoCounters(FFlist* result, FFNetIOOptions* options)
.rxPackets = ifm->ifm_data.ifi_ipackets,
.txErrors = ifm->ifm_data.ifi_oerrors,
.rxErrors = ifm->ifm_data.ifi_ierrors,
#ifdef _IFI_OQDROPS
.txDrops = if2m->ifm_data.ifi_oqdrops,
#ifdef FF_HAVE_IFI_OQDROPS
.txDrops = ifm->ifm_data.ifi_oqdrops,
#else
.txDrops = 0, // unsupported
#endif