diff options
Diffstat (limited to 'mDNSResponder/mDNSCore')
-rwxr-xr-x | mDNSResponder/mDNSCore/mDNS.c | 19 | ||||
-rwxr-xr-x | mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/mDNSResponder/mDNSCore/mDNS.c b/mDNSResponder/mDNSCore/mDNS.c index 9e1ac506..bf1bce2f 100755 --- a/mDNSResponder/mDNSCore/mDNS.c +++ b/mDNSResponder/mDNSCore/mDNS.c @@ -6092,7 +6092,7 @@ mDNSexport mStatus UpdateKeepaliveRData(mDNS *const m, AuthRecord *rr, NetworkIn } if ((intf != mDNSNULL) && (mti.IntfId != intf->InterfaceID)) { - LogInfo("mDNSPlatformRetrieveTCPInfo: InterfaceID mismatch mti.IntfId = %p InterfaceID = %p", mti.IntfId, intf->InterfaceID); + LogInfo("mDNSPlatformRetrieveTCPInfo: InterfaceID mismatch mti.IntfId = %p InterfaceID = %p", mti.IntfId, intf->InterfaceID); return mStatus_BadParamErr; } @@ -6661,6 +6661,7 @@ mDNSlocal void BeginSleepProcessing(mDNS *const m) NetworkInterfaceInfo *intf; for (intf = GetFirstActiveInterface(m->HostInterfaces); intf; intf = GetFirstActiveInterface(intf->next)) { + mDNSBool skipFullSleepProxyRegistration = mDNSfalse; // Intialize it to false. These values make sense only when SleepState is set to Sleeping. intf->SendGoodbyes = 0; @@ -6687,18 +6688,21 @@ mDNSlocal void BeginSleepProcessing(mDNS *const m) continue; } - // Check if we have already registered with a sleep proxy for this subnet + // Check if we have already registered with a sleep proxy for this subnet. + // If so, then the subsequent in-NIC sleep proxy registration is limited to any keepalive records that belong + // to the interface. if (skipSameSubnetRegistration(m, registeredIntfIDS, registeredCount, intf->InterfaceID)) { - LogSPS("%s : Skipping sleep proxy registration on %s", __func__, intf->ifname); - continue; + LogSPS("%s : Skipping full sleep proxy registration on %s", __func__, intf->ifname); + skipFullSleepProxyRegistration = mDNStrue; } #if APPLE_OSX_mDNSResponder - else if (SupportsInNICProxy(intf)) + if (SupportsInNICProxy(intf)) { mDNSBool keepaliveOnly = mDNSfalse; - if (ActivateLocalProxy(intf, &keepaliveOnly) == mStatus_NoError) + const mStatus err = ActivateLocalProxy(intf, skipFullSleepProxyRegistration, &keepaliveOnly); + if (!skipFullSleepProxyRegistration && !err) { SendGoodbyesForWakeOnlyService(m, &WakeOnlyService); @@ -6716,9 +6720,10 @@ mDNSlocal void BeginSleepProcessing(mDNS *const m) registeredIntfIDS[registeredCount] = intf->InterfaceID; registeredCount++; } + continue; } #endif // APPLE_OSX_mDNSResponder - else + if (!skipFullSleepProxyRegistration) { #if APPLE_OSX_mDNSResponder // If on battery, do not attempt to offload to external sleep proxies diff --git a/mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h b/mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h index 26c70089..e9f3bb8a 100755 --- a/mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h +++ b/mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h @@ -3390,7 +3390,7 @@ extern void RemoveAutoTunnel6Record(mDNS *const m); extern mDNSBool RecordReadyForSleep(AuthRecord *rr); // For now this LocalSleepProxy stuff is specific to Mac OS X. // In the future, if there's demand, we may see if we can abstract it out cleanly into the platform layer -extern mStatus ActivateLocalProxy(NetworkInterfaceInfo *const intf, mDNSBool *keepaliveOnly); +extern mStatus ActivateLocalProxy(NetworkInterfaceInfo *const intf, mDNSBool offloadKeepAlivesOnly, mDNSBool *keepaliveOnly); extern void mDNSPlatformUpdateDNSStatus(DNSQuestion *q); extern void mDNSPlatformTriggerDNSRetry(DNSQuestion *v4q, DNSQuestion *v6q); extern void mDNSPlatformLogToFile(int log_level, const char *buffer); |