From 6651a03a182c3d7dc0bd9fa07609196e565ceccb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 1 Sep 2021 14:09:18 +0200 Subject: [PATCH] system: weirdness in port parsing that we don't use; closes #5182 --- src/etc/inc/plugins.inc.d/openssh.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/etc/inc/plugins.inc.d/openssh.inc b/src/etc/inc/plugins.inc.d/openssh.inc index 32b0c3224..ecd740c28 100644 --- a/src/etc/inc/plugins.inc.d/openssh.inc +++ b/src/etc/inc/plugins.inc.d/openssh.inc @@ -219,11 +219,16 @@ function openssh_configure_do($verbose = false, $interface = '') continue; } - if (count($listeners) < 16) { - $listeners[] = $tmpaddr; - } else { + if (count($listeners) >= 16) { log_error("The SSH listening address $tmpaddr cannot be added due to MAX_LISTEN_SOCKS limit reached."); + continue; } + + if ($info['family'] == 'inet6') { + $tmpaddr = "[$tmpaddr]"; + } + + $listeners[] = $tmpaddr; } foreach ($listeners as $listener) {