- IPv6 support (bug #198377). Local-only sockets are IPv4, and ought to be
changed to unix domain sockets in future. - Resolves: rhbz#198377
This commit is contained in:
parent
017b9341b6
commit
5a3ed8e9f1
101
hplip-ipv6.patch
Normal file
101
hplip-ipv6.patch
Normal file
@ -0,0 +1,101 @@
|
||||
--- hplip-1.6.10/io/hpiod/jetdirect.cpp.ipv6 2006-04-18 23:34:15.000000000 +0100
|
||||
+++ hplip-1.6.10/io/hpiod/jetdirect.cpp 2006-10-30 13:56:15.000000000 +0000
|
||||
@@ -55,23 +55,35 @@
|
||||
|
||||
int JetDirectChannel::Open(char *sendBuf, int *result)
|
||||
{
|
||||
- struct sockaddr_in pin;
|
||||
+ struct sockaddr_storage pin;
|
||||
+ size_t addrlen;
|
||||
+ struct addrinfo *hostai;
|
||||
JetDirectDevice *pD = (JetDirectDevice *)pDev;
|
||||
char buf[LINE_SIZE];
|
||||
int r, len, port;
|
||||
|
||||
*result = R_IO_ERROR;
|
||||
|
||||
+ if (getaddrinfo (pD->GetIP(), NULL, NULL, &hostai) < 0)
|
||||
+ {
|
||||
+ syslog(LOG_ERR, "unable to resolve hostname %s\n", pD->GetIP());
|
||||
+ goto bugout;
|
||||
+ }
|
||||
+
|
||||
+ addrlen = hostai->ai_addrlen;
|
||||
bzero(&pin, sizeof(pin));
|
||||
- pin.sin_family = AF_INET;
|
||||
- pin.sin_addr.s_addr = inet_addr(pD->GetIP());
|
||||
+ memcpy(&pin, hostai->ai_addr, addrlen);
|
||||
+ freeaddrinfo(hostai);
|
||||
|
||||
switch (GetSocketID())
|
||||
{
|
||||
case PRINT_CHANNEL:
|
||||
port = PrintPort[pD->GetPort()];
|
||||
- pin.sin_port = htons(port);
|
||||
- if ((Socket = socket(AF_INET, SOCK_STREAM, 0)) == -1)
|
||||
+ if (pin.ss_family == AF_INET)
|
||||
+ ((struct sockaddr_in *)&pin)->sin_port = htons(port);
|
||||
+ else if (pin.ss_family == AF_INET6)
|
||||
+ ((struct sockaddr_in6 *)&pin)->sin6_port = htons(port);
|
||||
+ if ((Socket = socket(pin.ss_family, SOCK_STREAM, 0)) == -1)
|
||||
{
|
||||
syslog(LOG_ERR, "unable to open print port %d JetDirectChannel::Open: %m %s %s %d\n", port, pDev->GetURI(), __FILE__, __LINE__);
|
||||
goto bugout;
|
||||
@@ -87,9 +99,11 @@
|
||||
port = ScanPort0[pD->GetPort()];
|
||||
else
|
||||
port = ScanPort1[pD->GetPort()];
|
||||
- pin.sin_port = htons(port);
|
||||
-
|
||||
- if ((Socket = socket(AF_INET, SOCK_STREAM, 0)) == -1)
|
||||
+ if (pin.ss_family == AF_INET)
|
||||
+ ((struct sockaddr_in *)&pin)->sin_port = htons(port);
|
||||
+ else if (pin.ss_family == AF_INET6)
|
||||
+ ((struct sockaddr_in6 *)&pin)->sin6_port = htons(port);
|
||||
+ if ((Socket = socket(pin.ss_family, SOCK_STREAM, 0)) == -1)
|
||||
{
|
||||
syslog(LOG_ERR, "unable to open scan port %d JetDirectChannel::Open: %m %s %s %d\n", port, pDev->GetURI(), __FILE__, __LINE__);
|
||||
goto bugout;
|
||||
@@ -117,8 +131,12 @@
|
||||
port = GenericPort[pD->GetPort()];
|
||||
else
|
||||
port = GenericPort1[pD->GetPort()];
|
||||
- pin.sin_port = htons(port);
|
||||
- if ((Socket = socket(AF_INET, SOCK_STREAM, 0)) == -1)
|
||||
+
|
||||
+ if (pin.ss_family == AF_INET)
|
||||
+ ((struct sockaddr_in *)&pin)->sin_port = htons(port);
|
||||
+ else if (pin.ss_family == AF_INET6)
|
||||
+ ((struct sockaddr_in6 *)&pin)->sin6_port = htons(port);
|
||||
+ if ((Socket = socket(pin.ss_family, SOCK_STREAM, 0)) == -1)
|
||||
{
|
||||
syslog(LOG_ERR, "unable to open port %d JetDirectChannel::Open: %m %s %s %d\n", port, pDev->GetURI(), __FILE__, __LINE__);
|
||||
goto bugout;
|
||||
@@ -158,8 +176,11 @@
|
||||
break;
|
||||
case EWS_CHANNEL:
|
||||
port = 80;
|
||||
- pin.sin_port = htons(port);
|
||||
- if ((Socket = socket(AF_INET, SOCK_STREAM, 0)) == -1)
|
||||
+ if (pin.ss_family == AF_INET)
|
||||
+ ((struct sockaddr_in *)&pin)->sin_port = htons(port);
|
||||
+ else if (pin.ss_family == AF_INET6)
|
||||
+ ((struct sockaddr_in6 *)&pin)->sin6_port = htons(port);
|
||||
+ if ((Socket = socket(pin.ss_family, SOCK_STREAM, 0)) == -1)
|
||||
{
|
||||
syslog(LOG_ERR, "unable to open ews port %d JetDirectChannel::Open: %m %s %s %d\n", port, pDev->GetURI(), __FILE__, __LINE__);
|
||||
goto bugout;
|
||||
|
||||
--- hplip-1.6.10/base/g.py.ipv6 2006-10-30 15:09:12.000000000 +0000
|
||||
+++ hplip-1.6.10/base/g.py 2006-10-30 15:09:15.000000000 +0000
|
||||
@@ -166,8 +166,8 @@
|
||||
prop.hpssd_port = 0
|
||||
|
||||
|
||||
-prop.hpiod_host = 'localhost'
|
||||
-prop.hpssd_host = 'localhost'
|
||||
+prop.hpiod_host = '127.0.0.1'
|
||||
+prop.hpssd_host = '127.0.0.1'
|
||||
|
||||
prop.username = pwd.getpwuid(os.getuid())[0]
|
||||
pdb = pwd.getpwnam(prop.username)
|
10
hplip.spec
10
hplip.spec
@ -1,7 +1,7 @@
|
||||
Summary: HP Linux Imaging and Printing Project
|
||||
Name: hplip
|
||||
Version: 1.6.10
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
License: GPL/MIT/BSD
|
||||
Group: System Environment/Daemons
|
||||
Conflicts: system-config-printer < 0.6.132
|
||||
@ -20,6 +20,7 @@ Patch4: hplip-cups-backend.patch
|
||||
Patch5: hplip-broken-conf.patch
|
||||
Patch6: hplip-libm.patch
|
||||
Patch7: hplip-loop.patch
|
||||
Patch8: hplip-ipv6.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||
|
||||
Requires: desktop-file-utils >= 0.2.92
|
||||
@ -89,6 +90,9 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version}
|
||||
# Don't wake up every half a second (bug #204725).
|
||||
%patch7 -p1 -b .loop
|
||||
|
||||
# IPv6 support (bug #198377).
|
||||
%patch8 -p1 -b .ipv6
|
||||
|
||||
autoconf # for patch4
|
||||
|
||||
%build
|
||||
@ -189,6 +193,10 @@ fi
|
||||
exit 0
|
||||
|
||||
%changelog
|
||||
* Mon Oct 30 2006 Tim Waugh <twaugh@redhat.com> 1.6.10-3
|
||||
- IPv6 support (bug #198377). Local-only sockets are IPv4, and ought
|
||||
to be changed to unix domain sockets in future.
|
||||
|
||||
* Fri Oct 27 2006 Tim Waugh <twaugh@redhat.com> 1.6.10-2
|
||||
- 1.6.10. No longer need compile patch.
|
||||
- Fixed default config file (bug #211072).
|
||||
|
Loading…
Reference in New Issue
Block a user