Bugzilla – Attachment 34726 Details for
Bug 13252
SIP2 server should accept IPv6 connections
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 13252 - SIP2 server should accept IPv6 connections
PASSED-QA-Bug-13252---SIP2-server-should-accept-IP.patch (text/plain), 1.80 KB, created by
Katrin Fischer
on 2014-12-27 16:20:38 UTC
(
hide
)
Description:
[PASSED QA] Bug 13252 - SIP2 server should accept IPv6 connections
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-12-27 16:20:38 UTC
Size:
1.80 KB
patch
obsolete
>From ebe925401f60a83de564e2f62bab52a520324c80 Mon Sep 17 00:00:00 2001 >From: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> >Date: Thu, 13 Nov 2014 20:34:25 +0100 >Subject: [PATCH] [PASSED QA] Bug 13252 - SIP2 server should accept IPv6 > connections > >This small patch adds a check on the SIP2 socket connection if it is >IPv6 and resolves socket address accordingly. > >Any newer Debian distro would probably default to IPv6 so it would >eventually affect all SIP servers. > >Tests against running SIP server on an IPv6 box: > >http://wiki.koha-community.org/wiki/Koha_SIP2_server_setup#Testing_with_Telnet > >before patch: > disconnects immediately. Log output: > Bad arg length for Socket::unpack_sockaddr_in, length is 28, should be 16 > >after patch: > operates normally > >Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/SIP/SIPServer.pm | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > >diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm >index 45d8007..7e9c620 100755 >--- a/C4/SIP/SIPServer.pm >+++ b/C4/SIP/SIPServer.pm >@@ -88,8 +88,16 @@ sub process_request { > $self->{config} = $config; > > my $sockname = getsockname(STDIN); >- ($port, $sockaddr) = sockaddr_in($sockname); >- $sockaddr = inet_ntoa($sockaddr); >+ >+ # Check if socket connection is IPv6 before resolving address >+ my $family = Socket::sockaddr_family($sockname); >+ if ($family == AF_INET6) { >+ ($port, $sockaddr) = sockaddr_in6($sockname); >+ $sockaddr = Socket::inet_ntop(AF_INET6, $sockaddr); >+ } else { >+ ($port, $sockaddr) = sockaddr_in($sockname); >+ $sockaddr = inet_ntoa($sockaddr); >+ } > $proto = $self->{server}->{client}->NS_proto(); > > $self->{service} = $config->find_service($sockaddr, $port, $proto); >-- >1.9.1
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
|
Splinter Review
Attachments on
bug 13252
:
33530
|
33611
|
34001
| 34726 |
34727