]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/network.c
Merge changes from CUPS 1.4svn-r7961.
[thirdparty/cups.git] / scheduler / network.c
index b7057d7b440ed4a42ce4f928db4a1519487ab80e..6e15655afd994c9a7e203f43a75cb2aa3d75fefd 100644 (file)
@@ -1,26 +1,17 @@
 /*
- * "$Id: network.c 6086 2006-11-14 15:43:55Z mike $"
+ * "$Id: network.c 7861 2008-08-26 03:15:14Z mike $"
  *
  *   Network interface functions for the Common UNIX Printing System
  *   (CUPS) scheduler.
  *
+ *   Copyright 2007 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
+ *   property of Apple Inc. and are protected by Federal copyright
+ *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
  *   "LICENSE" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   file is missing or damaged, see the license at "http://www.cups.org/".
  *
  * Contents:
  *
@@ -254,24 +245,29 @@ cupsdNetIFUpdate(void)
       else if (addr->ifa_addr->sa_family == AF_INET &&
                lis->address.addr.sa_family == AF_INET &&
                (lis->address.ipv4.sin_addr.s_addr &
-                  temp->mask.ipv4.sin_addr.s_addr) ==
-                      temp->address.ipv4.sin_addr.s_addr)
+               temp->mask.ipv4.sin_addr.s_addr) ==
+                  (temp->address.ipv4.sin_addr.s_addr &
+                   temp->mask.ipv4.sin_addr.s_addr))
         match = 1;
 #ifdef AF_INET6
       else if (addr->ifa_addr->sa_family == AF_INET6 &&
                lis->address.addr.sa_family == AF_INET6 &&
                (lis->address.ipv6.sin6_addr.s6_addr[0] &
-                  temp->mask.ipv6.sin6_addr.s6_addr[0]) ==
-                      temp->address.ipv6.sin6_addr.s6_addr[0] &&
+               temp->mask.ipv6.sin6_addr.s6_addr[0]) ==
+                  (temp->address.ipv6.sin6_addr.s6_addr[0] &
+                   temp->mask.ipv6.sin6_addr.s6_addr[0]) &&
                (lis->address.ipv6.sin6_addr.s6_addr[1] &
-                  temp->mask.ipv6.sin6_addr.s6_addr[1]) ==
-                      temp->address.ipv6.sin6_addr.s6_addr[1] &&
+               temp->mask.ipv6.sin6_addr.s6_addr[1]) ==
+                  (temp->address.ipv6.sin6_addr.s6_addr[1] &
+                   temp->mask.ipv6.sin6_addr.s6_addr[1]) &&
                (lis->address.ipv6.sin6_addr.s6_addr[2] &
-                  temp->mask.ipv6.sin6_addr.s6_addr[2]) ==
-                      temp->address.ipv6.sin6_addr.s6_addr[2] &&
+               temp->mask.ipv6.sin6_addr.s6_addr[2]) ==
+                  (temp->address.ipv6.sin6_addr.s6_addr[2] &
+                   temp->mask.ipv6.sin6_addr.s6_addr[2]) &&
                (lis->address.ipv6.sin6_addr.s6_addr[3] &
-                  temp->mask.ipv6.sin6_addr.s6_addr[3]) ==
-                      temp->address.ipv6.sin6_addr.s6_addr[3])
+               temp->mask.ipv6.sin6_addr.s6_addr[3]) ==
+                  (temp->address.ipv6.sin6_addr.s6_addr[3] &
+                   temp->mask.ipv6.sin6_addr.s6_addr[3]))
         match = 1;
 #endif /* AF_INET6 */
 
@@ -293,8 +289,8 @@ cupsdNetIFUpdate(void)
 
     cupsArrayAdd(NetIFList, temp);
 
-    cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: \"%s\" = %s...",
-                    temp->name, temp->hostname);
+    cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: \"%s\" = %s:%d",
+                    temp->name, temp->hostname, temp->port);
   }
 
   freeifaddrs(addrs);
@@ -314,5 +310,5 @@ compare_netif(cupsd_netif_t *a,             /* I - First network interface */
 
 
 /*
- * End of "$Id: network.c 6086 2006-11-14 15:43:55Z mike $".
+ * End of "$Id: network.c 7861 2008-08-26 03:15:14Z mike $".
  */