aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiel van Baak <michiel@vanbaak.eu>2021-12-26 02:08:13 +0000
committerHiroki Tagato <tagattie@FreeBSD.org>2021-12-26 02:08:13 +0000
commitbad9dded1f1a65e48975b4f45f114c788d801fc5 (patch)
treef24c13aeecd4ffe2801599d55a07467f81535d8b
parentd9ad260f8a4a206251836e61353abab29832b765 (diff)
downloadports-bad9dded1f1a65e48975b4f45f114c788d801fc5.tar.gz
ports-bad9dded1f1a65e48975b4f45f114c788d801fc5.zip
net-p2p/prowlarr: tell .NET to disable ipv6 when system has not configured it
As stated in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259194#c17 .NET 6+ uses dual mode sockets to avoid the separate AF handling. This breaks on systems (jails) where ipv6 is not enabled. This patch detects this on prowlarr starts and disables .NET ipv6 support if no ipv6 is configured. PR: 260645 Reported by: Michiel van Baak <michiel@vanbaak.eu> (maintainer)
-rw-r--r--net-p2p/prowlarr/Makefile1
-rw-r--r--net-p2p/prowlarr/files/prowlarr.in8
2 files changed, 9 insertions, 0 deletions
diff --git a/net-p2p/prowlarr/Makefile b/net-p2p/prowlarr/Makefile
index d50d01787699..8847845fc052 100644
--- a/net-p2p/prowlarr/Makefile
+++ b/net-p2p/prowlarr/Makefile
@@ -1,5 +1,6 @@
PORTNAME= prowlarr
PORTVERSION= 0.1.8.1231
+PORTREVISION= 1
CATEGORIES= net-p2p
MASTER_SITES= https://github.com/Prowlarr/Prowlarr/releases/download/v${PORTVERSION}/
DISTNAME= Prowlarr.develop.${PORTVERSION}.freebsd-core-x64
diff --git a/net-p2p/prowlarr/files/prowlarr.in b/net-p2p/prowlarr/files/prowlarr.in
index db8c50e169dd..43e5bac3b626 100644
--- a/net-p2p/prowlarr/files/prowlarr.in
+++ b/net-p2p/prowlarr/files/prowlarr.in
@@ -40,6 +40,14 @@ start_precmd=${name}_precmd
install -d -o ${%%PORTNAME%%_user} -g ${%%PORTNAME%%_group} ${%%PORTNAME%%_pid_dir}
fi
+ # .NET 6+ use dual mode sockets to avoid the separate AF handling.
+ # disable .NET use of V6 if no ipv6 is configured.
+ # See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259194#c17
+ ifconfig | grep -q inet6
+ if [ $? == 1 ]; then
+ export DOTNET_SYSTEM_NET_DISABLEIPV6=1
+ fi
+
chown -R ${%%PORTNAME%%_user}:${%%PORTNAME%%_group} ${%%PORTNAME%%_exec_dir}
rc_flags="-r -f -p ${pidfile_child} -P ${pidfile} ${%%PORTNAME%%_exec_dir}/Prowlarr --data=${%%PORTNAME%%_data_dir} --nobrowser >> /dev/null 2>&1 ${rc_flags}"