The user has already enabled local network permissions.
However, when I use nw_connection_t for a local network TCP connection, nw_path_unsatisfied_reason returns nw_path_unsatisfied_reason_local_network_denied.
The system logs also indicate a lack of local network permissions.
This is an intermittent bug that typically occurs after uninstalling and reinstalling the app. Restarting the app does not help, toggling permissions on and off does not work, and uninstalling and reinstalling the app also fails to resolve the issue. Restarting the phone is the only solution, meaning users can only fix it by rebooting their device.
Networking
RSS for tagExplore the networking protocols and technologies used by the device to connect to Wi-Fi networks, Bluetooth devices, and cellular data services.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm using NETransparentProxyProvider to intercept udp sockets using the method handleNewUDPFlow. An application may create a UDP socket and set the DONTFRAG using setsockopt method
setsockopt(s, IPPROTO_IP, IP_DONTFRAG, &val, sizeof(val))
In this case, do I have option in this case, to get the connection settings inside the callback
(void)handleNewUDPFlow:(NEAppProxyUDPFlow *)flow initialRemoteEndpoint:(NWEndpoint *)remoteEndpoint;
So in this case, I would be able to create the outgoing socket with the exact same characteristics, after the original app socket got intercepted by my proxy provider ?
Hello, we have noticed a crash in BigSur 11.7.10, 20G1427 libdispatch:
Crashed Thread: 1 Dispatch queue: com.apple.network.connections
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [94088]
Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: Release of a suspended object
Thread 0:
0 libsystem_kernel.dylib 0x00007fff20488aea __sigsuspend_nocancel + 10
1 libdispatch.dylib 0x00007fff2031f4e1 _dispatch_sigsuspend + 36
2 libdispatch.dylib 0x00007fff2031f4bd _dispatch_sig_thread + 53
Thread 1 Crashed:: Dispatch queue: com.apple.network.connections
0 libdispatch.dylib 0x00007fff2033cc35 _dispatch_queue_xref_dispose.cold.1 + 24
1 libdispatch.dylib 0x00007fff20313808 _dispatch_queue_xref_dispose + 50
2 libdispatch.dylib 0x00007fff2030e2eb -[OS_dispatch_source _xref_dispose] + 17
3 libnetwork.dylib 0x00007fff24255999 __nw_queue_context_create_source_block_invoke + 41
4 libdispatch.dylib 0x00007fff2030d623 _dispatch_call_block_and_release + 12
5 libdispatch.dylib 0x00007fff2030e806 _dispatch_client_callout + 8
6 libdispatch.dylib 0x00007fff203111b0 _dispatch_continuation_pop + 423
7 libdispatch.dylib 0x00007fff203211f4 _dispatch_source_invoke + 1181
8 libdispatch.dylib 0x00007fff20316318 _dispatch_workloop_invoke + 1784
9 libdispatch.dylib 0x00007fff2031ec0d _dispatch_workloop_worker_thread + 811
10 libsystem_pthread.dylib 0x00007fff204b545d _pthread_wqthread + 314
11 libsystem_pthread.dylib 0x00007fff204b442f start_wqthread + 15
I have seen similar crashes in the forum, but none from com.apple.network.connections queue.
Should we raise a ticket or is this something that was fixed in newer OS versions?
Thanks!
Jakub
I've been trying very unsuccessfully to get the Filtering Network Traffic example code to work. I've read many forum posts but I still wasn't able to figure it out.
I download the example project and set my development team for both targets. From then on the project is configured to create unique bundle identifiers and app group. Signing and provisioning profile is created and managed by Xcode with all the necessary entitlements. I am able to build the app (debug with provisioning profile) and then copy it to /Applications.
I open the app, click start, enable and allow the network extension. Activity Monitor shows that the extension is running.
But when I test local connections to port 8888 nothing happens in the app, the connection are just allowed. I tested with the following setup:
create a local webserver with python3 -m http.server 8888 and make a request via curl and the webbrowser
normal tcp connection with nc (nc -l 8888 and nc localhost 8888)
I added lots of logging and I can see that the startFilter method is called, but never the handleNewFlow method.
The only error I see in Console is
networkd_settings_read_from_file Sandbox is preventing this process from reading networkd settings file at "/Library/Preferences/com.apple.networkd.plist", please add an exception.
but don't know what to do about that. I also read the debugging guide (very helpful).
I'm used to jump through a lot of hoops with this stuff, but I can't figure out what the problem is.
Hi everyone,
We are working on creating a virtual network interface using NEPacketTunnelProvider, with an MTU of 1500 bytes.
I would like to understand what will happen if we attempt to write packets of approximately 65,000 bytes to this interface. Specifically, will the packets be fragmented based on protocol and flags, will they be dropped, or is there another unexpected behaviour we should anticipate?
Thanks
Topic:
App & System Services
SubTopic:
Networking
With little knowledge on C++, but help from ChatGPT, I am trying to write a plugin for OBS.
I would like to include a bonjour service in the plugin. I assume that the framework is already present on every Mac, but I don't know where it resides, and how to #include it.
Anyone can help me here?
Thanks in advance
https://developer.apple.com/forums/thread/735862?login=true
Feedback Ticket: FB13812251
Problem Statement: We are currently facing internet connectivity issue with our VPN application where we try to disconnect the VPN from the Packet Tunnel Network Extension using - (void)cancelTunnelWithError:(nullable NSError *)error. Which API to use to disconnect the VPN from Packet Tunnel as VPN app is not running such that device retains its internet connectivity as soon as VPN disconnects.
Configuration: We have configured PacketTunnelProvider with the following settings:
(NETunnelProviderManager *)tunnelProvider.protocolConfiguration.includeAllNetworks = YES;
(NETunnelProviderManager *)tunnelProvider.protocolConfiguration.excludeLocalNetworks = NO;
(NETunnelProviderManager *)tunnelProvider.protocolConfiguration.enforceRoutes = NO;
These settings are applied from the VPN app and allow us to successfully establish a VPN connection, with all traffic being routed through the tunnel as expected.We are setting above properties to address local net attack.
Issue we are facing:
However, we encounter a problem when we attempt to disconnect the VPN from. When we call the following method from PacketTunnel network extension:
(void)cancelTunnelWithError:(nullable NSError *)error
Upon calling this method, the VPN disconnects as expected, but the device loses all internet connectivity and is unable to access any resources. This is not the desired behavior.
Observation : Interestingly, when we call the following method from the app side. The VPN disconnects and the device retains its internet connectivity.
[enabledConfig.connection stopVPNTunnel];
We would like to achieve the same behavior when disconnecting the VPN from the Network Extension. So we are looking for an API that could be called from NE without causing any internet connectivity issue.
Any guidance on how to resolve this issue would be greatly appreciated.
Didn't get any response last time so reposting my query. I know procID is of no use in IOS but just for curiosity I am logging proc ID in control Filter and data Filter.
I was trying to log the flow description using control filter and data filter. But when I am trying to log the proc ID in control filter, it is always 0, but in data filter, it logs some value. Same goes with the eproc ID. I want to use the flow description data in some other target so I will be sending the data using sockets and I cannot share data from data filter due to its restrictions and control filter isn't providing the proc ID. What should I do?
I was trying to fetch inBytes and outBytes in content filter. Each time it is logging 0 as inByte and outByte in handleNewFlow flow description. How to get inByte and outByte of the flow?
Hi,
We are developing an app using PacketTunnelProvider from Network Extension framework. It is packaged as a system extension.
We are trying to implement an "always-on" functionality, but cannot manage to start the extension before user login, with or without on-demand enabled.
However we see in other posts (1, 2) that a network extension packaged as sysex should automatically start before user login.
Are we missing something? Is it a limitation of PacketTunnelProvider?
Thanks
I want to configure one aspect of my networking configuration (the QUIC keepalive interval). This only seems to be configurable via Network.framework’s nw_quic_set_keepalive_interval. Is there any way to apply this to a URLSession? Or do I need to implement the whole connection management myself using Network.framework?
Note that AsyncDNSResolver is a fairly new Apple sponsored framework (search for it).
I am trying to resolve a hostname (behind a CNAME) but cannot. In face even "ping" in mac Terminal can't.
The host I start with is apidev.leaptodigital.com - when I ask for its CNAME:
resolver.queryCNAME(name: "apidev.leaptodigital.com")
I get:
salespro-dev-server-2.eba-uxpxmksr.us-east-1.elasticbeanstalk.com
Great! But nothing I try with that hostname returns an IP address. I tried queryCNAME again, then queryA, then queryAAAA.
Yet I can send http traffic to this host, so its getting resolved somewhere.
Note that nslookup in Terminal finds it just fine.
David
PS: tried older APIs like CFHostStartInfoResolution but they don't return anything either. Did not try getHostName as its use is discouraged.
Topic:
App & System Services
SubTopic:
Networking
NEFilterManager.shared().loadFromPreferences { loadError in
DispatchQueue.global.async {
...
}
}
the code above is executed in an app-like deamon and completionHandler was never invoked, same code in an application works fine.(they are both packed with content filter network system extension)
is it because of the restriction of app-like deamon?
Hi,
I am working on a use case where I want to read the wifi signal strength data in the terms of RSSI (Received Signal Strength Indicator) values (or) any other way of representation. when my iPhone is connected to the wifi and Move around the house.
Is this use case possible ? If yes, what are all the entitlements that I have to obtain?
We have an app which is using CTSubscriber.simInserted (using the carrier entitlement com.apple.CommCenter.fine-grained).
In iOS 18, simInserted returns false for every sim (where it should instead be returning true).
Presumably this just is a temporary bug in 18 beta?
In my case there are three interfaces. I had a mental model that I now believe is incorrect.
If any of the 3 interfaces is "satisfied", then I get one message telling me so. I guess if that one interface goes down, then I should get a second message that tells me that (this is hard to test as Xcode keeps disconnecting from my device when I switch to Settings to change things).
in my case, wifi and cellular are both on. I launch the app, get notified that wifi is satisfied, but nothing on cellular.
So my guess is there is a hierarchy: wired, wifi, and cellular. If the highest priority path is available, the others are assumed "off" since you have a path. Thus, you will never get "satisfied" for more than one path.
Correct?
Case-ID: 10969723
(Due to privacy concerns, I have hidden part of the URL and included the complete plain text in the email demo project with Case-ID: 10969723)
After our game was launched in Japan, a small number of Japanese users reported that they were unable to enter the game. After our investigation, we confirmed that the request under the yfy-api-oversea.xxxxxxxxxxxxxx.com domain name failed.
iOS NSURLSession API returns the following error:
Error Domain=NSURLErrorDomain Code=-1000 "無効なURL" UserInfo={_kCFStreamErrorCodeKey=22, NSUnderlyingError=0x3019e8030 {Error Domain=kCFErrorDomainCFNetwork Code=-1000 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11], ipv4, ipv6, dns, proxy, uses wifi, _kCFStreamErrorCodeKey=22, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<7>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<7>"
), NSLocalizedDescription=無効なURL, NSErrorFailingURLStringKey=https://yfy-api-oversea.xxxxxxxxxxxxxx.com/init/info?channel_code=jpxxxxxxxxxxxxxxios×tamp=1735012505&sign=1617e4cf88b58df2aa90a6b3985a8ac2&game_code=XXXXX, NSErrorFailingURLKey=https://yfy-api-oversea.xxxxxxxxxxxxxx.com/init/info?channel_code=jpxxxxxxxxxxxxxxios×tamp=1735012505&sign=1617e4cf88b58df2aa90a6b3985a8ac2&game_code=XXXXX, _kCFStreamErrorDomainKey=1}。
We have tried various methods but cannot reproduce this error (Code=-1000).
I can provide the following clues:
1、We have checked the server and confirmed that the request did not reach the server, but was intercepted by the iOS client and was not sent.
2、This problem does not seem to have much to do with the iOS system version. The system versions where the problem occurred are widely distributed: 17.2.1、17.7.1、17.5.1、17.6.1、17.7、18.0.1、18.1、18.1.1 e.g.
3、This problem seems to have nothing to do with the device model. The following models have experienced problems: iPhone16、iPhone 16 Pro、iPhone 14、iPhone 14 Plus、iPhone 14 Pro Max、iPhone 13、iPhone11 e.g.
4、By tracking the logs, some users who encountered the problem later recovered and the problem did not occur again(The user IP and iOS system restored by yourself have not changed). However, this problem persists for some users. Even if the iOS system is upgraded to the latest version, there are still problems.
5、The following two IPs are the IPs of users who encountered this problem (1.73.13.210, 153.252.131.136). But this problem seems to have nothing to do with IP. For some users who restored themselves, their IPs did not change, but the problem no longer occurred.
6、This problem seems to only occur in Japan. Mainland China, Taiwan, and Hong Kong have never encountered this situation.
7、It doesn't seem to have anything to do with GET requests. Another login request(https://yfy-api-oversea.xxxxxxxxxxxxxx.com/login/c/place)uses a POST request and will also encounter this error.
8、I wonder if it has something to do with the two symbol "-" in the domain name?
I checked Apple documentation and searched online, but couldn't find any more information. This problem cannot be reproduced either. Only technical requests can be initiated.
I provided a demo project(see email for Case-ID: 10969723)
Thanks.
We are checking for cellular mode using the code below.
When the code below is executed, is it correct to convey the status value of the actually connected cellular environment?
Sometimes HSDPA or WCDMA is output.
I would like to inquire under what conditions the value is output.
[Code]
func getCellularConnectionType() -&gt; String {
if #available(iOS 14.1, *) {
if let radioAccessTechnology = networkInfo.serviceCurrentRadioAccessTechnology?.values.first {
Debug.log("Radio Access Technology: (radioAccessTechnology)")
switch radioAccessTechnology {
case CTRadioAccessTechnologyLTE:
return "LTE"
case CTRadioAccessTechnologyNRNSA:
return "5G-NSA"
case CTRadioAccessTechnologyNR:
return "5G-SA"
default:
return "ETC"
}
}
}
return "Cellular"
}
I have an app that tracks Wi-Fi and Cellular data usage. Many users want to see tracking per sim, and I can't find a way to achieve that. It seems like iOS reports data usage from every sim into pdp_ip0 interface.
Is there any place to look into?
Hi all,
I'm struggling to identify the cause of a really strange issue that has started to plague our network of Mac devices. We use Cisco switches and have port security turned on which means any device that registers more than one MAC address triggers a port violation which then shuts down the port for a short period of time (5 mins I believe).
A few months ago we suddenly started get lots of violations from Mac devices the were all registering additional MAC addresses (2 usually) that all had the same 6 character prefix (00:00:40).
So far we've not been able to determine the cause and now getting pretty desperate and exploring all possible avenues.
All we know id that prefix is registered to a company called Applicon from back in the day but is now shut down.
Has anyone come across this issue or know of any possible reason why this may be happening?
Thanks
Topic:
App & System Services
SubTopic:
Networking