Skip to content

Commit

Permalink
Medium: ldirectord: Fix the issue in IPv4/IPv6 mixed environment
Browse files Browse the repository at this point in the history
  • Loading branch information
kjtakeda committed May 31, 2016
1 parent 75a712c commit b298b4f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ldirectord/ldirectord.in
Original file line number Diff line number Diff line change
Expand Up @@ -2889,6 +2889,8 @@ sub check_http
{
use LWP::UserAgent;
use LWP::Debug;
use Net::HTTP;
use URI;
if($DEBUG > 2) {
LWP::Debug::level('+');
}
Expand All @@ -2901,9 +2903,12 @@ sub check_http
. "virtualhost=\"$virtualhost\"");

if (inet_pton(AF_INET6,&ld_strip_brackets($host))) {
no warnings 'once';
require Net::INET6Glue::INET_is_INET6;
# Workaround for Net-HTTP IPv6 Address URLs Broken
}

# Workaround for Net-HTTP IPv6 Address URLs Broken
if ($LWP::VERSION < 6.08 || $Net::HTTP::VERSION < 6.07 || $URI::VERSION < 1.64) {
no warnings 'once';
@LWP::Protocol::http::EXTRA_SOCK_OPTS = (PeerAddr => $host,
PeerHost => &ld_strip_brackets($host),
Host => &ld_strip_brackets($host));
Expand Down

0 comments on commit b298b4f

Please sign in to comment.