rpms/hplip/devel hplip-ipv6.patch,NONE,1.1 hplip.spec,1.95,1.96

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Oct 30 15:32:40 UTC 2006


Author: twaugh

Update of /cvs/dist/rpms/hplip/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv12208

Modified Files:
	hplip.spec 
Added Files:
	hplip-ipv6.patch 
Log Message:
* Mon Oct 30 2006 Tim Waugh <twaugh at 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.
- Resolves: rhbz#198377


hplip-ipv6.patch:
 base/g.py              |    4 ++--
 io/hpiod/jetdirect.cpp |   45 +++++++++++++++++++++++++++++++++------------
 2 files changed, 35 insertions(+), 14 deletions(-)

--- NEW FILE hplip-ipv6.patch ---
--- 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)


Index: hplip.spec
===================================================================
RCS file: /cvs/dist/rpms/hplip/devel/hplip.spec,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- hplip.spec	27 Oct 2006 17:01:02 -0000	1.95
+++ hplip.spec	30 Oct 2006 15:32:38 -0000	1.96
@@ -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 @@
 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 @@
 # 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 @@
 exit 0
 
 %changelog
+* Mon Oct 30 2006 Tim Waugh <twaugh at 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 at redhat.com> 1.6.10-2
 - 1.6.10.  No longer need compile patch.
 - Fixed default config file (bug #211072).




More information about the fedora-cvs-commits mailing list