From 2e131b3106796165a0ea1cc050c9ce22bc96bcdf Mon Sep 17 00:00:00 2001 From: djfiander Date: Fri, 6 Apr 2007 20:49:06 +0000 Subject: [PATCH] Apply Bill Erickson's patch to clean up matching an incoming connection against the configuration file. There's no longer a special case for 127.0.0.1, so it will not longer match 'localhost', but it doesn't match any other hostnames anyway. --- Sip/Configuration.pm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Sip/Configuration.pm b/Sip/Configuration.pm index 1c4e259..5b1ddb1 100644 --- a/Sip/Configuration.pm +++ b/Sip/Configuration.pm @@ -63,15 +63,10 @@ sub find_service { my ($self, $sockaddr, $port, $proto) = @_; my $portstr; - if ($sockaddr eq '127.0.0.1') { - foreach my $addr ('', '*:', 'localhost:', '127.0.0.1:') { - $portstr = sprintf("%s%s/%s", $addr, $port, $proto); - Sys::Syslog::syslog("LOG_DEBUG", "Configuration::find_service: Trying $portstr"); - last if (exists(($self->{listeners})->{$portstr})); - } - } else { - $portstr = sprintf("%s:%s/%s", $sockaddr, $port, $proto); + foreach my $addr ('', '*:', "$sockaddr:") { + $portstr = sprintf("%s%s/%s", $addr, $port, $proto); Sys::Syslog::syslog("LOG_DEBUG", "Configuration::find_service: Trying $portstr"); + last if (exists(($self->{listeners})->{$portstr})); } return $self->{listeners}->{$portstr}; -- 2.11.0