Bug 36948: (follow-up) Allow IPv[46] in port config

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Marcel de Rooy 2024-05-24 07:55:27 +00:00 committed by Martin Renvoize
parent c0d76f707b
commit fcd7e884bc
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
3 changed files with 10 additions and 6 deletions

View file

@ -39,8 +39,8 @@ sub new {
my %listeners;
# The key to the listeners hash is the 'port' component of the
# configuration, which is of the form '[host]:[port]/proto', and
# the 'proto' component could be upper-, lower-, or mixed-cased.
# configuration, which is of the form '[host]:[port]/proto[/IPv[46]]'
# The 'proto' component could be upper-, lower-, or mixed-cased.
# Regularize it here to lower-case, and then do the same below in
# find_server() when building the keys to search the hash.
@ -76,6 +76,10 @@ sub find_service {
siplog( "LOG_DEBUG",
"Configuration::find_service: Trying $portstr" );
last if ( exists( ( $self->{listeners} )->{$portstr} ) );
$portstr .= '/ipv4'; # lc, see ->new
last if ( exists( ( $self->{listeners} )->{$portstr} ) );
$portstr .= '/ipv6'; # lc, see ->new
last if ( exists( ( $self->{listeners} )->{$portstr} ) );
}
return $self->{listeners}->{$portstr};
}

View file

@ -20,13 +20,13 @@
protocol="NCIP/1.0" />
-->
<service
port="127.0.0.1:8023/tcp"
port="127.0.0.1:8023/tcp/IPv4"
transport="telnet"
protocol="SIP/2.00"
timeout="60" />
<service
port="127.0.0.1:6001/tcp"
port="127.0.0.1:6001/tcp/IPv4"
transport="RAW"
protocol="SIP/2.00"
client_timeout="600"

View file

@ -29,13 +29,13 @@
protocol="NCIP/1.0" />
-->
<service
port="8023/tcp"
port="127.0.0.1:8023/tcp/IPv4"
transport="telnet"
protocol="SIP/2.00"
timeout="60" />
<service
port="127.0.0.1:6001/tcp"
port="127.0.0.1:6001/tcp/IPv4"
transport="RAW"
protocol="SIP/2.00"
client_timeout="600"