From e630e02baeb10b8d1038ab4b76c2c5b1b068c527 Mon Sep 17 00:00:00 2001 From: "Troy C." <327529+troxor@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:31:22 -0500 Subject: [PATCH] softflowd: update to 1.1.1 Add -S option to force the exports out of a named interface Add -B option for overriding libpcap buffer size, added in 1.1.0 Add -e option to send Exporter IP in Data Templates, added in 1.1.1 Remove upstreamed patch for %lld Add patch to fix warnings with poll.h Signed-off-by: Troy C. <327529+troxor@users.noreply.github.com> --- net/softflowd/Makefile | 6 +- net/softflowd/files/softflowd.config | 2 + net/softflowd/files/softflowd.init | 7 +- net/softflowd/patches/001-fix-poll-h.patch | 11 ++ .../030-Use-lld-for-time_t-always.patch | 114 ------------------ 5 files changed, 21 insertions(+), 119 deletions(-) create mode 100644 net/softflowd/patches/001-fix-poll-h.patch delete mode 100644 net/softflowd/patches/030-Use-lld-for-time_t-always.patch diff --git a/net/softflowd/Makefile b/net/softflowd/Makefile index 7b4dfc10b87e5..dccc9ad81fbfb 100644 --- a/net/softflowd/Makefile +++ b/net/softflowd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=softflowd -PKG_VERSION:=1.1.0 -PKG_RELEASE:=2 +PKG_VERSION:=1.1.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/irino/softflowd/tar.gz/softflowd-v$(PKG_VERSION)? -PKG_HASH:=68d36a21895d0b155b27c718c4b79cc304a4de92d591d73887ccfd74f90f4ffc +PKG_HASH:=a6882e59931e5880901f8ee28d78b082cb3000ad8d28af35c13f2b528edbb2c9 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-v$(PKG_VERSION) PKG_MAINTAINER:=Ross Vandegrift diff --git a/net/softflowd/files/softflowd.config b/net/softflowd/files/softflowd.config index ee0634634bbd1..dac876e179acb 100644 --- a/net/softflowd/files/softflowd.config +++ b/net/softflowd/files/softflowd.config @@ -14,3 +14,5 @@ config softflowd option bidirectional '0' option sampling_rate '100' option filter '' + option exporter_ip '' + option send_interface 'br-lan' diff --git a/net/softflowd/files/softflowd.init b/net/softflowd/files/softflowd.init index 5becd451468d6..80c59d65a484d 100755 --- a/net/softflowd/files/softflowd.init +++ b/net/softflowd/files/softflowd.init @@ -43,8 +43,11 @@ start_instance() { append_string "$section" 'hoplimit' '-L' append_string "$section" 'tracking_level' '-T' append_string "$section" 'sampling_rate' '-s' - append_bool "$section" track_ipv6 '-6' - append_bool "$section" bidirectional '-b' + append_string "$section" 'send_interface' '-S' + append_string "$section" 'pcap_buffer_size' '-B' + append_string "$section" 'exporter_ip' '-e' + append_bool "$section" 'track_ipv6' '-6' + append_bool "$section" 'bidirectional' '-b' procd_open_instance procd_set_param command /usr/sbin/softflowd -d $args${pid_file:+ -p $pid_file} "$filter" diff --git a/net/softflowd/patches/001-fix-poll-h.patch b/net/softflowd/patches/001-fix-poll-h.patch new file mode 100644 index 0000000000000..c29c6e57ffc63 --- /dev/null +++ b/net/softflowd/patches/001-fix-poll-h.patch @@ -0,0 +1,11 @@ +--- a/common.h ++++ b/common.h +@@ -33,7 +33,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/net/softflowd/patches/030-Use-lld-for-time_t-always.patch b/net/softflowd/patches/030-Use-lld-for-time_t-always.patch deleted file mode 100644 index 33d812e0b33f3..0000000000000 --- a/net/softflowd/patches/030-Use-lld-for-time_t-always.patch +++ /dev/null @@ -1,114 +0,0 @@ -From f96142c9f3267a09976cd8a6bb4cc601830bce9b Mon Sep 17 00:00:00 2001 -From: Sebastian Kemper -Date: Fri, 21 Oct 2022 23:37:42 +0200 -Subject: [PATCH] Use %lld for time_t always - -Compiling softflowd against musl 1.2.x for 32 bit targets shows some -warnings: - -softflowd.c: In function 'format_flow': -softflowd.c:307:13: warning: format '%ld' expects argument of type 'long int', but argument 15 has type 'suseconds_t' {aka 'long long int'} [-Wformat=] - 307 | "seq:%" PRIu64 " [%s]:%hu <> [%s]:%hu proto:%u " - | ^~~~~~~ -...... - 315 | (flow->flow_start.tv_usec + 500) / 1000, fin_time, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - | | - | suseconds_t {aka long long int} -softflowd.c:309:27: note: format string is defined here - 309 | "start:%s.%03ld finish:%s.%03ld tcp>:%02x tcp<:%02x " - | ~~~~^ - | | - | long int - | %03lld -softflowd.c:307:13: warning: format '%ld' expects argument of type 'long int', but argument 17 has type 'suseconds_t' {aka 'long long int'} [-Wformat=] - 307 | "seq:%" PRIu64 " [%s]:%hu <> [%s]:%hu proto:%u " - | ^~~~~~~ -...... - 316 | (flow->flow_last.tv_usec + 500) / 1000, flow->tcp_flags[0], - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - | | - | suseconds_t {aka long long int} -softflowd.c:309:43: note: format string is defined here - 309 | "start:%s.%03ld finish:%s.%03ld tcp>:%02x tcp<:%02x " - | ~~~~^ - | | - | long int - | %03lld -softflowd.c: In function 'dump_flows': -softflowd.c:1173:16: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'time_t' {aka 'long long int'} [-Wformat=] - 1173 | "EXPIRY EVENT for flow %" PRIu64 " in %ld seconds\n", - | ^~~~~~~~~~~~~~~~~~~~~~~~~ - 1174 | expiry->flow->flow_seq, (long int) expiry->expires_at - now); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - | | - | time_t {aka long long int} -softflowd.c:1173:56: note: format string is defined here - 1173 | "EXPIRY EVENT for flow %" PRIu64 " in %ld seconds\n", - | ~~^ - | | - | long int - | %lld - -Dumping flow data results in a segmentation fault: - -root@OpenWrt:~# softflowctl dump-flows -softflowd[6688]: Dumping flow data: - -No further output. But in the system log a segmentation fault is -visible: - -Fri Oct 21 07:13:47 2022 kern.info kernel: [745743.417947] do_page_fault(): sending SIGSEGV to softflowd for invalid read access from 00000326 -Fri Oct 21 07:13:47 2022 kern.info kernel: [745743.427175] epc = 77de0dc0 in libc.so[77d62000+a9000] -Fri Oct 21 07:13:47 2022 kern.info kernel: [745743.432682] ra = 77de2b04 in libc.so[77d62000+a9000] -Fri Oct 21 07:13:47 2022 kern.info kernel: [745743.443552] device br-lan.1 left promiscuous mode -Fri Oct 21 07:13:47 2022 kern.info kernel: [745743.448485] device br-lan left promiscuous mode -Fri Oct 21 07:13:52 2022 kern.info kernel: [745748.464316] device br-lan.1 entered promiscuous mode -Fri Oct 21 07:13:52 2022 kern.info kernel: [745748.469774] device br-lan entered promiscuous mode - -This was reported on the OpenWrt "packages" repository's issue tracker -([1]). - -musl 1.2 has time64 support, meaning it always uses 64 bit time_t (also -when compiling for 32 bit targets), to be Y2K38 safe. This commit -changes the format specifier from "%ld" to "%lld" to fix the compiler -warnings and make the segmentation fault go away. - -[1] https://github.com/openwrt/packages/issues/19655 - -Signed-off-by: Sebastian Kemper ---- - softflowd.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - ---- a/softflowd.c -+++ b/softflowd.c -@@ -316,14 +316,14 @@ format_flow (struct FLOW *flow) { - snprintf (buf, sizeof (buf), - "seq:%" PRIu64 " [%s]:%hu <> [%s]:%hu proto:%u " - "octets>:%u packets>:%u octets<:%u packets<:%u " -- "start:%s.%03ld finish:%s.%03ld tcp>:%02x tcp<:%02x " -+ "start:%s.%03lld finish:%s.%03lld tcp>:%02x tcp<:%02x " - "flowlabel>:%08x flowlabel<:%08x " - "vlan>:%u vlan<:%u ether:%s <> %s", flow->flow_seq, addr1, - ntohs (flow->port[0]), addr2, ntohs (flow->port[1]), - (int) flow->protocol, flow->octets[0], flow->packets[0], - flow->octets[1], flow->packets[1], start_time, -- (flow->flow_start.tv_usec + 500) / 1000, fin_time, -- (flow->flow_last.tv_usec + 500) / 1000, flow->tcp_flags[0], -+ (long long) ((flow->flow_start.tv_usec + 500) / 1000), fin_time, -+ (long long) ((flow->flow_last.tv_usec + 500) / 1000), flow->tcp_flags[0], - flow->tcp_flags[1], flow->ip6_flowlabel[0], - flow->ip6_flowlabel[1], flow->vlanid[0], flow->vlanid[1], - format_ethermac (flow->ethermac[0]), -@@ -1194,8 +1194,8 @@ dump_flows (struct FLOWTRACK *ft, FILE * - expiry->expires_at == 0 ? " (FORCED)" : ""); - } else { - fprintf (out, -- "EXPIRY EVENT for flow %" PRIu64 " in %ld seconds\n", -- expiry->flow->flow_seq, (long int) expiry->expires_at - now); -+ "EXPIRY EVENT for flow %" PRIu64 " in %lld seconds\n", -+ expiry->flow->flow_seq, (long long) expiry->expires_at - now); - } - fprintf (out, "\n"); - }