};
start_time = CFAbsoluteTimeGetCurrent();
handler = ^(int32_t num_prefixes, nw_nat64_prefix_t *prefixes) {
- Boolean set_prefix_failed = FALSE;
+ Boolean remove_resolver = FALSE;
if (!NAT64PrefixRequestFlagsIsSet(request,
kRequestFlagsValid)) {
}
if (prefixes != NULL) {
/* set prefixes on the interface */
- if (!_nat64_prefix_set(request->if_name,
- num_prefixes, prefixes)) {
- set_prefix_failed = TRUE;
- }
+ _nat64_prefix_set(request->if_name,
+ num_prefixes, prefixes);
+ remove_resolver = TRUE;
} else {
SC_log(LOG_ERR, "%s: NAT64 no prefixes",
request->if_name);
num_prefixes, prefixes, start_time);
#if TEST_NAT64_CONFIGURATION
if (G_set_prefixes_force_failure) {
- set_prefix_failed = TRUE;
+ remove_resolver = TRUE;
}
#endif /* TEST_NAT64_CONFIGURATION */
- if (set_prefix_failed) {
+ if (remove_resolver) {
/* remove resolver */
NAT64PrefixRequestInvalidate(request);
NAT64PrefixRequestRelease(request);
/*
- * Copyright (c) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (c) 2015-2017, 2019 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
if (xpc_get_type(info) == XPC_TYPE_ARRAY) {
xpc_array_apply(info, ^bool(size_t index, xpc_object_t value) {
#pragma unused(index)
- if (value && xpc_get_type(value) == XPC_TYPE_DICTIONARY) {
- agent_uuid = xpc_dictionary_get_value(info,
+ if ((value != NULL) &&
+ (xpc_get_type(value) == XPC_TYPE_DICTIONARY)) {
+ agent_uuid = xpc_dictionary_get_value(value,
kConfigAgentOutOfBandDataUUID);
if (agent_uuid != NULL) {
return false;
kConfigAgentOutOfBandDataUUID);
}
- if (agent_uuid != NULL) {
+ if ((agent_uuid != NULL) &&
+ (xpc_get_type(agent_uuid) == XPC_TYPE_DATA) &&
+ (xpc_data_get_length(agent_uuid) >= sizeof(uuid_t))) {
const void *bytes = xpc_data_get_bytes_ptr(agent_uuid);
uuid_copy(uuid, bytes);
} else {
xpc_object_t
config_agent_get_dns_nameservers(xpc_object_t resolver)
{
- if (resolver == NULL) {
+ if ((resolver == NULL) ||
+ (xpc_get_type(resolver) != XPC_TYPE_DICTIONARY)) {
return NULL;
}
xpc_object_t
config_agent_get_dns_searchdomains(xpc_object_t resolver)
{
- if (resolver == NULL) {
+ if ((resolver == NULL) ||
+ (xpc_get_type(resolver) != XPC_TYPE_DICTIONARY)) {
return NULL;
}
<true/>
<key>com.apple.private.necp.policies</key>
<true/>
+ <key>com.apple.security.network.client</key>
+ <true/>
<key>com.apple.SystemConfiguration.SCPreferences-write-access</key>
<array>
<string>SCTestPreferences.plist</string>
<dict>
<key>com.apple.private.networkextension.configuration</key>
<true/>
+ <key>com.apple.security.network.client</key>
+ <true/>
</dict>
</plist>