I'm running unifi7 on an opnsense 23.7.11 box, based on FreeBSD 13.2 with unifi7 version 7.5.187_1. The system is fully dual stack, but out of the box the java processes for the unifi7 application (web UI and such) appear to bind only to IPv4. I've confirmed that explicitly toggling java.net.preferIPv4Stack in /usr/local/etc/rc.d/unifi to 'false' permits the application to bind to both v4 and v6 (tcp46 bind). The java docs at https://docs.oracle.com/javase%2F7%2Fdocs%2Fapi%2F%2F/java/net/doc-files/net-properties.html indicate that this setting *should* be 'false' by default, but in an out-of-the-box setup it definitely was only listening on v4 for me. I don't have another system to validate this on at the moment, but if it *is* binding on v4 by default, could we toss an explicit '-Djava.net.preferIPv4Stack=false' in the rc script to permit a dual AF bind by default? e.g.: $ diff -u unifi unifi_afbind --- unifi 2024-01-07 18:27:14 +++ unifi_afbind 2024-01-07 18:27:07 @@ -46,6 +46,7 @@ : ${unifi_chdir=/usr/local/share/java/unifi} : ${unifi_java_home=/usr/local/openjdk17} : ${unifi_javaflags="-Djava.awt.headless=true -Xmx1024M \ + -Djava.net.preferIPv4Stack=false \ --add-opens java.base/java.lang=ALL-UNNAMED \ --add-opens java.base/java.time=ALL-UNNAMED \ --add-opens java.base/sun.security.util=ALL-UNNAMED \
^Triage: rename correctly and assign to maintainer
I will do this change for net-mgmt/unifi8, as unifi7 is slated for expiration soon.
Much appreciated, thank you.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=00d2fcdaab14b18f2a4e132f7a7557c84c704061 commit 00d2fcdaab14b18f2a4e132f7a7557c84c704061 Author: Juraj Lutter <otis@FreeBSD.org> AuthorDate: 2024-01-12 12:03:04 +0000 Commit: Juraj Lutter <otis@FreeBSD.org> CommitDate: 2024-01-12 12:13:00 +0000 net-mgmt/unifi8: Allow binding to both INET and INET6 addresses PR: 276213 net-mgmt/unifi8/Makefile | 1 + net-mgmt/unifi8/files/unifi.in | 1 + 2 files changed, 2 insertions(+)
Committed, thanks.