Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1440977 Details for
Bug 1578026
Can't call method "sockhostname" without a package or object reference at /usr/share/perl5/vendor_perl/HTTP/Daemon.pm line 64.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed fix
HTTP-Daemon-6.01-Resolve-specific-socket-addresses-correctly.patch (text/plain), 1.81 KB, created by
Petr Pisar
on 2018-05-24 08:43:28 UTC
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2018-05-24 08:43:28 UTC
Size:
1.81 KB
patch
obsolete
>From e49f553aa8be21e5df72452e50af2e9f0b82ecad Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> >Date: Wed, 23 May 2018 17:31:42 +0200 >Subject: [PATCH] Resolve specific socket addresses correctly >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Previous code did not formatted specific (not 0.0.0.0 or ::) >correctly: > >$ perl -MHTTP::Daemon -e '$d=HTTP::Daemon->new(LocalAddr=>q{127.0.0.2}) or die; print $d->url, qq{\n}' >Can't call method "sockhostname" without a package or object reference at /usr/share/perl5/vendor_perl/HTTP/Daemon.pm line 64. > >This patch also fixes formatting numerical IPv6 addresses. It seems >that IO::Socket::IP::sockhostname() formats unresolvable addresses too. > >Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com> >--- > lib/HTTP/Daemon.pm | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/lib/HTTP/Daemon.pm b/lib/HTTP/Daemon.pm >index 1e9d48e..216c73f 100644 >--- a/lib/HTTP/Daemon.pm >+++ b/lib/HTTP/Daemon.pm >@@ -61,12 +61,23 @@ sub url > $url .= '[' . inet_ntop(AF_INET6, $addr) . ']'; > } > else { >- my $host = $addr->sockhostname; >+ my $host = $self->sockhostname; >+ # sockhostname() seems to return a stringified IP address if not >+ # resolvable, then quote it for a port separator and an IPv6 zone separator. >+ # But be paranoid for a case when it already contains a bracket. >+ if (defined $host and $host =~ /:/) { >+ if ($host =~ /[\[\]]/) { >+ $host = undef; >+ } else { >+ $host =~ s/%/%25/g; >+ $host = '[' . $host . ']'; >+ } >+ } > if (!defined $host) { > if (sockaddr_family($addr) eq AF_INET6) { > $host = '[' . inet_ntop(AF_INET6, $addr) . ']'; > } else { >- $host = inet_ntop(AF_INET6, $addr); >+ $host = inet_ntop(AF_INET, $addr); > } > } > $url .= $host; >-- >2.14.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1578026
:
1436772
| 1440977