git: 4c6bb66915d4 - main - net/socat: Add configurable IPv4/IPv6 preference option

From: Emanuel Haupt <ehaupt_at_FreeBSD.org>
Date: Sat, 09 Dec 2023 11:48:48 UTC
The branch main has been updated by ehaupt:

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

commit 4c6bb66915d405ad49d3d843c6fdd2857e9371c8
Author:     Emanuel Haupt <ehaupt@FreeBSD.org>
AuthorDate: 2023-12-09 11:48:40 +0000
Commit:     Emanuel Haupt <ehaupt@FreeBSD.org>
CommitDate: 2023-12-09 11:48:44 +0000

    net/socat: Add configurable IPv4/IPv6 preference option
    
    In socat version 1.8.0.0, a new feature was introduced allowing users to
    configure the default IP version preference at build time using the
    `--enable-default-ipv` option. This change resulted in a default
    preference for IPv6, which led to unexpected behavior for some users.
    
    To address this, a new option has been added to the FreeBSD port of
    socat. By default, the port restores the previous behavior where IPv4
    is preferred. However, users now have the option to explicitly specify a
    preference for IPv6 if desired.
    
    This change aims to align with the Principle of Least Astonishment
    (POLA) and provide users with flexibility in choosing their preferred IP
    version.
    
    PR:             275653 (based on)
---
 net/socat/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/socat/Makefile b/net/socat/Makefile
index 048726802dd7..b9742ae1ae51 100644
--- a/net/socat/Makefile
+++ b/net/socat/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	socat
 DISTVERSION=	1.8.0.0
+PORTREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	http://www.dest-unreach.org/socat/download/ \
 		LOCAL/ehaupt
@@ -26,7 +27,11 @@ PLIST_FILES=	bin/filan \
 		man/man1/socat.1.gz
 PORTDOCS=	EXAMPLES FAQ README SECURITY
 
-OPTIONS_DEFINE=	DOCS READLINE
+OPTIONS_DEFINE=	DOCS READLINE IPV6DEFAULT
+IPV6DEFAULT_DESC=	Use IPv6 by default
+
+IPV6DEFAULT_CONFIGURE_OFF=		--enable-default-ipv=4
+IPV6DEFAULT_CONFIGURE_ENABLE=		default-ipv=6
 
 READLINE_USES=			readline
 READLINE_CONFIGURE_ENABLE=	readline