Bugzilla – Attachment 33530 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]
Bug 13252 - SIP2 server should accept IPv6 connections
Bug-13252---SIP2-server-should-accept-IPv6-connect.patch (text/plain), 1.67 KB, created by
Benjamin Rokseth
on 2014-11-13 19:45:37 UTC
(
hide
)
Description:
Bug 13252 - SIP2 server should accept IPv6 connections
Filename:
MIME Type:
Creator:
Benjamin Rokseth
Created:
2014-11-13 19:45:37 UTC
Size:
1.67 KB
patch
obsolete
>From efe75fe376b7f337ebda88bf89e9cb4034481498 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] 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 >--- > 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.7.10.4
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