summaryrefslogtreecommitdiff
path: root/scheduler/network.c
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2014-01-06 21:59:35 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2014-01-06 21:59:35 +0000
commit84ec3a84450c4ded1d1847dc5becdfa8ed4c7c4b (patch)
tree8d6a27ac113edb2b59657527a47e13efada5b9ee /scheduler/network.c
parentf2a7bf2a934df8166e1b3f47b4836211db79ea47 (diff)
downloadcups-84ec3a84450c4ded1d1847dc5becdfa8ed4c7c4b.tar.gz
Using "@IF(name)" in an Allow or Deny rule did not work (STR #4328)
Move the cupsdNetIFUpdate call before the name check - we need to update for all names. Add debug logging to show interfaces that are skipped and other "errors". git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11497 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler/network.c')
-rw-r--r--scheduler/network.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/scheduler/network.c b/scheduler/network.c
index 054faa50f..350f4e3e9 100644
--- a/scheduler/network.c
+++ b/scheduler/network.c
@@ -1,23 +1,16 @@
/*
* "$Id$"
*
- * Network interface functions for the CUPS scheduler.
+ * Network interface functions for the CUPS scheduler.
*
- * Copyright 2007-2012 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 2007-2014 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
- * These coded instructions, statements, and computer programs are the
- * 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, see the license at "http://www.cups.org/".
- *
- * Contents:
- *
- * cupsdNetIFFind() - Find a network interface.
- * cupsdNetIFFree() - Free the current network interface list.
- * cupsdNetIFUpdate() - Update the network interface list as needed...
- * compare_netif() - Compare two network interfaces.
+ * These coded instructions, statements, and computer programs are the
+ * 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, see the license at "http://www.cups.org/".
*/
/*
@@ -133,7 +126,10 @@ cupsdNetIFUpdate(void)
*/
if (getifaddrs(&addrs) < 0)
+ {
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: Unable to get interface list - %s", strerror(errno));
return;
+ }
for (addr = addrs; addr != NULL; addr = addr->ifa_next)
{
@@ -148,7 +144,10 @@ cupsdNetIFUpdate(void)
#endif
) ||
addr->ifa_netmask == NULL || addr->ifa_name == NULL)
+ {
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: Ignoring \"%s\".", addr->ifa_name);
continue;
+ }
/*
* Try looking up the hostname for the address as needed...
@@ -178,7 +177,10 @@ cupsdNetIFUpdate(void)
hostlen = strlen(hostname);
if ((temp = calloc(1, sizeof(cupsd_netif_t) + hostlen)) == NULL)
+ {
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: Unable to allocate memory for interface.");
break;
+ }
/*
* Copy all of the information...