Skip to content

Commit 0110584

Browse files
committed
NetIO (*BSD): support OpenBSD & NetBSD
1 parent 254f121 commit 0110584

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ elseif(NetBSD)
722722
src/detection/media/media_linux.c
723723
src/detection/memory/memory_obsd.c
724724
src/detection/mouse/mouse_nosupport.c
725-
src/detection/netio/netio_nosupport.c
725+
src/detection/netio/netio_bsd.c
726726
src/detection/opengl/opengl_linux.c
727727
src/detection/os/os_nbsd.c
728728
src/detection/packages/packages_obsd.c
@@ -804,7 +804,7 @@ elseif(OpenBSD)
804804
src/detection/media/media_linux.c
805805
src/detection/memory/memory_obsd.c
806806
src/detection/mouse/mouse_nosupport.c
807-
src/detection/netio/netio_nosupport.c
807+
src/detection/netio/netio_bsd.c
808808
src/detection/opengl/opengl_linux.c
809809
src/detection/os/os_obsd.c
810810
src/detection/packages/packages_obsd.c

src/detection/netio/netio_bsd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ const char* ffNetIOGetIoCounters(FFlist* result, FFNetIOOptions* options)
4848
.rxPackets = ifm->ifm_data.ifi_ipackets,
4949
.txErrors = ifm->ifm_data.ifi_oerrors,
5050
.rxErrors = ifm->ifm_data.ifi_ierrors,
51+
#ifdef _IFI_OQDROPS
52+
.txDrops = if2m->ifm_data.ifi_oqdrops,
53+
#else
5154
.txDrops = 0, // unsupported
55+
#endif
5256
.rxDrops = ifm->ifm_data.ifi_iqdrops,
5357
.defaultRoute = sdl->sdl_index == defaultRouteIfIndex,
5458
};

src/modules/netio/netio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void ffInitNetIOOptions(FFNetIOOptions* options)
264264

265265
ffStrbufInit(&options->namePrefix);
266266
options->defaultRouteOnly =
267-
#ifdef __ANDROID__
267+
#if __ANDROID__ || __OpenBSD__
268268
false
269269
#else
270270
true

0 commit comments

Comments
 (0)