Created attachment 240758 [details] Patch unbreaking rc.d script and providing some fixes This patch primarily unbreaks rc.d scirpt, and additionally provides some improvements. Port passes testport and builds fine in poudriere. 1. %%ETCDIR%%/$name.conf expands to /usr/local/etc/fasnetmon/fastnetmon.conf, but we are installing the config file with path /usr/local/etc/fastnetmon.conf - let's unbreak it. 2. --daemonize wants to be first, otherwise, the startup script fails - fixed. 3. Oleksander okolita75@gmail.com submitted PR (bug 245751) with the apparent fix for Netmap support - let's try it. 4. Redis is now required, remove REDIS from options then. It's interesting software, thanks for taking care and updating to the most recent version farrokhi@ !
5. -DDISABLE_PF_RING_SUPPORT=ON removed as no more relevant after the transition to cmake
There is another problem with GoBGP API, Fastnetmon relies on the older, non-compatible version of GoBGP < 3.0. The upstream is aware of the problem, but it's hard to tell when they'll eventually come up with the solution[1]. The latest working version is GoBGP v2.34.0 from December 2021, but we don't have it in ports. We can either make the port partially broken (if possible) or create net/gobp2 for users who want this feature. [1] https://github.com/pavel-odintsov/fastnetmon/issues/966
Created attachment 240798 [details] Patch containing misc fixes Fixes provided: 1. Path to config dir %%ETCDIR%%/$name.conf expanded to /usr/local/etc/fasnetmon/fastnetmon.conf, but we wer installing the config file with path /usr/local/etc/fastnetmon.conf - fixed. 2. --daemonize wanted to be first, otherwise, the startup script failed - fixed. 3. Oleksander okolita75@gmail.com submitted PR (bug 245751) with the apparent fix for Netmap support - let's try it. 4. Redis is now a dependency, remove REDIS from options then. 5. -DDISABLE_PF_RING_SUPPORT=ON removed as no more relevant after the transition to cmake 6. GoBGP v3.0.0 has different API, let's make it working again - fixed, tested with net/gobgp v3.12.0 from ports. 7. Some logging files/directories were mising. Without writable /var/log/fastnetmon.log the daemon won't start - fixed. The port passes testport and build fine in poudriere. The daemon installs and starts almost out of the box. The integration with GoBGP is possible again. I haven't tested Netmap though. Please don't hesitate to commit all this legwork done today. Cheers !
Thanks for your contribution. I have been trying to fix a few things with current port, including unbreaking build on 12.x and a few other improvements. I tried to fix netmap and gobgp along the way. Enabling netmap is a bit more complicated than it seems (I am trying to get a build on 12.x and 13.x on various platforms), without many dirty hacks. As for GoBGP, I'd recommend we do not go with a huge patch, and create a net/gobgp2 port as a more generic solutions. Please feel free to create that port so we can enable gobgp support in fastnetmon in future.
(In reply to Babak Farrokhi from comment #4) Thanks for the reply. I have tried to create net/gobgp2 port, but it was non-trivial since the last 2.x was released 1.5 years ago, so it's a really deprecated version. Moreover, 2.x doesn't support the blacklisting of IPv6[1]. So in the meantime, the upstream transitioned to GoBGP 3.12 following our patch to solve problems with IPv6 bans[2], so I'd rather avoid switching to GoBGP 2.x. With regard to improvements to the port, I found out that the creation of the log file I proposed is wrong, it should be held a different way since the log is now checked for mismatched checksum together with notify script and netwok_list files[3]. Perhaps we should move everything to /usr/local/etc/fastnetmon/ directory, and leave sample files only there (notify script, networks_ files and sample fastnetmon.conf file) and change logging to fastnetmon.log in /var/log/fastnemon/ directory which we can create? [1] https://github.com/pavel-odintsov/fastnetmon/issues/966 [2] https://github.com/pavel-odintsov/fastnetmon/commit/61eb8c5edd1264c23c6d5ce2bf1e8f4b37d9cae0 [3] Checking for packages with mismatched checksums: fastnetmon-1.2.4_1: /usr/local/bin/notify_about_attack.sh fastnetmon-1.2.4_1: /usr/local/etc/networks_list fastnetmon-1.2.4_1: /var/log/fastnetmon.log
@Marek: Thanks for your contribution. I cleaned up the patch, fixed a couple of other things and removed GoBGP changes. Let's wait for the future release with a proper GoBGP integration.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3002262c9396ba38da42839a1a8c48ef444f80f0 commit 3002262c9396ba38da42839a1a8c48ef444f80f0 Author: Babak Farrokhi <farrokhi@FreeBSD.org> AuthorDate: 2023-03-24 14:56:36 +0000 Commit: Babak Farrokhi <farrokhi@FreeBSD.org> CommitDate: 2023-03-24 14:56:36 +0000 net-mgmt/fastnetmon: Unreak build on 12.x - Unbreak build on 12.x - Enable netmap support - Cleanup unused options - Fix startup script PR: 270126 net-mgmt/fastnetmon/Makefile | 13 ++++++------- net-mgmt/fastnetmon/files/fastnetmon.in | 6 +++--- .../patch-src_netmap__plugin_netmap__collector.cpp (new) | 10 ++++++++++ net-mgmt/fastnetmon/pkg-plist | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-)