From e73924b650c4dc36a6fee2e2203738b41955a9ca Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 24 May 2024 07:55:27 +0000 Subject: [PATCH] Bug 36948: (follow-up) Allow IPv[46] in port config Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize (cherry picked from commit fcd7e884bc6a16bc0552c1f40b9ecfc7e8b255aa) Signed-off-by: Lucas Gass (cherry picked from commit 309cc9c9d11ce92bb0fa7dace981bd25b615c592) Signed-off-by: Fridolin Somers --- C4/SIP/Sip/Configuration.pm | 8 ++++++-- debian/templates/SIPconfig.xml | 4 ++-- etc/SIPconfig.xml | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/C4/SIP/Sip/Configuration.pm b/C4/SIP/Sip/Configuration.pm index 819ec1d486..5c74b124a7 100644 --- a/C4/SIP/Sip/Configuration.pm +++ b/C4/SIP/Sip/Configuration.pm @@ -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}; } diff --git a/debian/templates/SIPconfig.xml b/debian/templates/SIPconfig.xml index 53b0638802..e79a2950b6 100644 --- a/debian/templates/SIPconfig.xml +++ b/debian/templates/SIPconfig.xml @@ -20,13 +20,13 @@ protocol="NCIP/1.0" /> --> -->