MacOS left in a state with a broken networking configuration if vpnc-script disconnect hook is interrupted
It seems that openconnect, just after you kill it with CTRL+C, executes another foreground process to clean the DNSs & delete network/host configs. Pressing CTRL+C more than once will kill also that second process, meaning that DNSs are not cleared and that internet navigation will not work correctly anymore.
See also the following screenshot that shows that the delete net
and delete hosts
commands are run after the first ^C.
How to reproduce
On Mac OS:
- Connect with openconnect to a VPN
- Close it pressing CTRL+C many times
- Try to navigate the web / check on Preferences > Network > Advanced... > DNS if there are some leftovers
Additional details
- Mac OS 12.6
-
zsh
terminal running insideiTerm2