You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Improved network interface support on MacOSX #2085
OK, I've tweaked your changes slightly - basically, now we'll depend on NetIFUpdate on all platforms, with the old timeout logic being used on operating systems without the system management support. That should make adding the D-BUS stuff for Linux simpler (they have a similar set of network change notifications now) and limits the number of time() calls we do otherwise...
/* TODO: Possibly update when MDNS support is added? */
cupsdLogMessage(CUPSD_LOG_DEBUG,
"Deregistering local printer "%s"", p->name);
cupsdSendBrowseDelete(p);
@@ -334,12 +339,6 @@
"System network configuration changed");
/*
\* Force an update of the list of network interfaces in 2 seconds.
- */
- NetIFTime = time(NULL) - 58;
/*
\* Resetting browse_time before calling cupsdSendBrowseList causes
browse packets to be sent for local shared printers. /
@@ -407,8 +406,8 @@
SCDynamicStoreRef store = NULL;/ System Config dynamic store /
CFRunLoopSourceRef powerRLS = NULL,/ Power runloop source /
storeRLS = NULL;/ System Config runloop source */
CFStringRef key[3], /* System Config keys */
pattern[1]; /\* System Config patterns */
CFStringRef key[5], /* System Config keys */
pattern[2]; /* System Config patterns */
CFArrayRef keys = NULL, /* System Config key array_/
patterns = NULL;/_ System Config pattern array /
SCDynamicStoreContext storeContext; / Dynamic store context */
@@ -449,33 +448,58 @@
if (!ComputerNameKey)
ComputerNameKey = SCDynamicStoreKeyCreateComputerName(NULL);
+#else
VAR time_t NetIFTime VALUE(0);
/_ Network interface list time /
+#endif /APPLE/
+
VAR cups_array_t *NetIFList VALUE(NULL);
/ Array of network interfaces */
Activity
michaelrsweet commentedon Nov 14, 2006
CUPS.org User: mike
OK, I've tweaked your changes slightly - basically, now we'll depend on NetIFUpdate on all platforms, with the old timeout logic being used on operating systems without the system management support. That should make adding the D-BUS stuff for Linux simpler (they have a similar set of network change notifications now) and limits the number of time() calls we do otherwise...
michaelrsweet commentedon Nov 14, 2006
"sysman.patch":
Index: scheduler/sysman.c
--- scheduler/sysman.c (revision 6073)
+++ scheduler/sysman.c (working copy)
@@ -115,12 +115,18 @@
/* The runloop. Access must be protected! /
static CFStringRef ComputerNameKey = NULL,
/ Computer name key */
/*
@@ -306,7 +312,6 @@
}
else
{
/* TODO: Possibly update when MDNS support is added? */
cupsdLogMessage(CUPSD_LOG_DEBUG,
"Deregistering local printer "%s"", p->name);
cupsdSendBrowseDelete(p);
@@ -334,12 +339,6 @@
"System network configuration changed");
- */
- NetIFTime = time(NULL) - 58;
/
@@ -407,8 +406,8 @@
SCDynamicStoreRef store = NULL;/ System Config dynamic store /
CFRunLoopSourceRef powerRLS = NULL,/ Power runloop source /
storeRLS = NULL;/ System Config runloop source */
CFStringRef key[3], /* System Config keys */
CFStringRef key[5], /* System Config keys */
CFArrayRef keys = NULL, /* System Config key array_/
patterns = NULL;/_ System Config pattern array /
SCDynamicStoreContext storeContext; / Dynamic store context */
@@ -449,33 +448,58 @@
if (!ComputerNameKey)
ComputerNameKey = SCDynamicStoreKeyCreateComputerName(NULL);
if (!NetworkGlobalKey)
NetworkGlobalKey =
if (!NetworkGlobalKeyIPv4)
NetworkGlobalKeyIPv4 =
SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
kSCDynamicStoreDomainState,
kSCEntNetIPv4);
if (!NetworkGlobalKeyIPv6)
NetworkGlobalKeyIPv6 =
if (!NetworkGlobalKeyDNS)
NetworkGlobalKeyDNS =
SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
if (!HostNamesKey)
HostNamesKey = SCDynamicStoreKeyCreateHostNames(NULL);
if (!NetworkInterfaceKey)
NetworkInterfaceKey =
if (!NetworkInterfaceKeyIPv4)
NetworkInterfaceKeyIPv4 =
SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL,
kSCDynamicStoreDomainState,
kSCCompAnyRegex,
kSCEntNetIPv4);
if (store && ComputerNameKey && NetworkGlobalKey && HostNamesKey &&
if (!NetworkInterfaceKeyIPv6)
NetworkInterfaceKeyIPv6 =
if (store && ComputerNameKey && HostNamesKey &&
{
key[0] = ComputerNameKey;
key[1] = NetworkGlobalKey;
key[2] = HostNamesKey;
pattern[0] = NetworkInterfaceKey;
key[1] = NetworkGlobalKeyIPv4;
key[2] = NetworkGlobalKeyIPv6;
key[3] = NetworkGlobalKeyDNS;
key[4] = HostNamesKey;
pattern[0] = NetworkInterfaceKeyIPv4;
pattern[1] = NetworkInterfaceKeyIPv6;
keys = CFArrayCreate(NULL, (const void *)key,
sizeof(key) / sizeof(key[0]),
&kCFTypeArrayCallBacks);
+
patterns = CFArrayCreate(NULL, (const void *)pattern,
sizeof(pattern) / sizeof(pattern[0]),
&kCFTypeArrayCallBacks);
@@ -682,12 +706,17 @@
if (CFArrayContainsValue(changedKeys, range, ComputerNameKey))
threadData->sysevent.event |= SYSEVENT_NAMECHANGED;
threadData->sysevent.event |= SYSEVENT_NETCHANGED;
/*
@@ -695,7 +724,7 @@
*/
CFRunLoopTimerSetNextFireDate(threadData->timerRef,
Index: scheduler/network.c
--- scheduler/network.c (revision 6073)
+++ scheduler/network.c (working copy)
@@ -112,6 +112,17 @@
char hostname[1024]; /* Hostname for address */
+#ifdef APPLE
+/*
+
+#else
/*
@@ -121,6 +132,7 @@
return;
NetIFTime = time(NULL);
+#endif /* APPLE */
/*
Free the old interfaces...
--- scheduler/network.h (revision 6073)Index: scheduler/network.h
+++ scheduler/network.h (working copy)
@@ -43,8 +43,14 @@
*/
+#ifdef APPLE
+VAR int NetIFUpdate VALUE(1);
VAR time_t NetIFTime VALUE(0);
/_ Network interface list time /
+#endif / APPLE /
+
VAR cups_array_t *NetIFList VALUE(NULL);
/ Array of network interfaces */