Skip to content

vpn_status: Better VPN detection - prevent libvirt false-positive#2322

Merged
ultrabug merged 1 commit into
ultrabug:masterfrom
jdholtz:better-vpn-detection
Apr 30, 2026
Merged

vpn_status: Better VPN detection - prevent libvirt false-positive#2322
ultrabug merged 1 commit into
ultrabug:masterfrom
jdholtz:better-vpn-detection

Conversation

@jdholtz

@jdholtz jdholtz commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Fix #2321. A tun interface on Linux is more broad than just a VPN interface. It can also refer to interfaces used in a virtualized network (as shown in the issue). This PR uses a stronger VPN detection mechanism by making sure the interface is not marked as a port/slave in NetworkManager (indicating it is part of a broader virtualized network).

We can't rely on the Vpn property unfortunately because during testing, I found that an OpenVPN client does not have the VPN property marked as true in NetworkManager.

Also mentioned in the issue, I added better parsing of the IPs for an interface so it doesn't fail if either IP key doesn't exist (instead it would just return None for the respective IP).

@jdholtz

jdholtz commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

CI failure might be because of an outdated Hatch version? I'm not exactly sure, I cannot reproduce it locally.

@ultrabug
ultrabug merged commit bc02798 into ultrabug:master Apr 30, 2026
2 of 7 checks passed
@ultrabug

Copy link
Copy Markdown
Owner

Thanks a lot!

@jdholtz
jdholtz deleted the better-vpn-detection branch April 30, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vpn_status crashes when a VM network interface exists

2 participants