I am trying to set includeAllNetworks flags right now and I see some wield behaviors from macOS system:
default 13:32:50.825941+0800 ***** <debug> newStatus = Connecting...
default 13:32:51.816353+0800 ***** <debug> newStatus = Disconnected
default 13:32:52.222371+0800 ***** <debug> newStatus = Connected
The app which is observing VPN status gets notified with disconnected status between connecting and connected. And in some cases I find that app will never gets connected notification after disconnected. In that case tunnel interface and all tunnel network settings are well set. But our UI logic will just handle the disconnected case.
If I just clear the includeAllNetwork flag, then everything is fine.
default 14:13:50.075947+0800 *****<debug> newStatus = Connecting...
default 14:13:50.829195+0800 *****<debug> newStatus = Connected
The test environment is macOS 14.0 and I am using network extension framework for the status KVO.
So I am just wondering if this is expected behavior or not. If this is expected, then is there any suggestion that I should use to work around it?