git: ba6fef6feed4 - main - net-p2p/cardano-node: Fix startup on systems without ipv6.

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Mon, 26 Sep 2022 07:13:39 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ba6fef6feed41cf3a30a566f93bd58c2f01f2d4a

commit ba6fef6feed41cf3a30a566f93bd58c2f01f2d4a
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2022-09-22 16:09:03 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2022-09-26 07:13:32 +0000

    net-p2p/cardano-node: Fix startup on systems without ipv6.
---
 net-p2p/cardano-node/Makefile              | 2 +-
 net-p2p/cardano-node/files/cardano_node.in | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/net-p2p/cardano-node/Makefile b/net-p2p/cardano-node/Makefile
index 9b510a851e95..f6ff9d3c3fc1 100644
--- a/net-p2p/cardano-node/Makefile
+++ b/net-p2p/cardano-node/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	cardano-node
 PORTVERSION=	1.35.3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net-p2p
 
 MAINTAINER=	arrowd@FreeBSD.org
diff --git a/net-p2p/cardano-node/files/cardano_node.in b/net-p2p/cardano-node/files/cardano_node.in
index 53d33cbebd45..74c7fb2d3890 100644
--- a/net-p2p/cardano-node/files/cardano_node.in
+++ b/net-p2p/cardano-node/files/cardano_node.in
@@ -135,7 +135,13 @@ jail_root="${_home}/jail"
 jail_topology="/topology_dir/`basename ${_topology}`"
 jail_config="/config_dir/`basename ${_config}`"
 jail_socket="/socket/`basename ${_socket}`"
-jail_cmd="jail -c name=${name}_jail path=${jail_root} exec.jail_user=cardano exec.system_jail_user ip4=inherit ip6=inherit host=inherit"
+jail_ip6_arg=""
+sysctl -q kern.features.inet6 2> /dev/null
+if [ "$?" = "0" ]
+then
+    jail_ip6_arg="ip6=inherit"
+fi
+jail_cmd="jail -c name=${name}_jail path=${jail_root} exec.jail_user=cardano exec.system_jail_user ip4=inherit ${jail_ip6_arg} host=inherit"
 
 pidfile="/var/run/${name}.pid"
 flags="run +RTS ${_rts_flags} -RTS \