Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TAP / OpenVPN connections are not visible #375

Closed
wolph opened this issue Nov 23, 2020 · 13 comments
Closed

TAP / OpenVPN connections are not visible #375

wolph opened this issue Nov 23, 2020 · 13 comments
Assignees
Labels

Comments

@wolph
Copy link

wolph commented Nov 23, 2020

Describe your issue:

The list of interfaces doesn't show TAP / OpenVPN (and other VPN) client connections.

Steps to reproduce the issue:

  1. Connect to a VPN
  2. Try to find the information in the interfaces list

NETworkManager version: 2020.5.1

Windows version: Windows 10 v2004 (build 19041.546)

.NET-Framework version: Probably not relevant either way, where can I find out?

Screenshots
image

@BornToBeRoot
Copy link
Owner

BornToBeRoot commented Nov 23, 2020

Are you sure? Maybe under a different name like "Ethernet XY"?

I have also use the OpenVPN adapter and i can see it in the list as Ethernet device.

image

image

image

@wolph
Copy link
Author

wolph commented Nov 23, 2020

Yes I'm pretty sure. It seems there are actually 2 interfaces missing:
image

image

@BornToBeRoot
Copy link
Owner

Interessting... the NetworkInterfaceType ist 53 for this adapters...

https://docs.microsoft.com/en-us/windows-hardware/drivers/network/ndis-interface-types
https://stackoverflow.com/questions/58821325/networkinterfacetype-53

Here is the "bug"/filter:

if (networkInterface.NetworkInterfaceType != NetworkInterfaceType.Ethernet && networkInterface.NetworkInterfaceType != NetworkInterfaceType.Wireless80211)

I will add it for the next release! Thanks for reporting!

@wolph
Copy link
Author

wolph commented Nov 23, 2020

Excellent! Thank you for the quick fix :)

@wolph
Copy link
Author

wolph commented Nov 23, 2020

Out of curiosity, wouldn't duck typing be a better option in that bit of code? Accept all options but with a try/catch or attribute test instead? This code looks prone to breaking if someone thinks of a new NetworkInterfaceType

@BornToBeRoot
Copy link
Owner

The most common are Ethernet and Wireless80211. It seems like the Tap adapther is sometimes recognized as virtual/internal interface.

The problem is, when you allow everything, you might get interfaces like modem, isdn, etc.. This shouldn't be a problem if you only display the details, but i don't know what happen if you try to configure (static ip, dns) the interface from my tool or capture network packages (LLDP/CDP). And i don't have a device to test all these interface types.

According to the .net documentation, there are only a few interfaces:
https://docs.microsoft.com/en-us/dotnet/api/system.net.networkinformation.networkinterfacetype?view=net-5.0

if you look at other documentations from microsoft, there are a lot more interfaces defined:
https://docs.microsoft.com/en-us/windows-hardware/drivers/network/ndis-interface-types

For now i would add the type 53 in the if condition. This was also the first time (in 4 years) someone reported an issues, that an interface was missing.

@wolph
Copy link
Author

wolph commented Nov 23, 2020

Yes, that makes sense :)

As a fellow developer I'm always a bit scared when I see these types of special cases without any else as it can cause issues you'll never notice. In this case however... it prevents rare and hard to reproduce bugs so I guess it's the better of the two :)

@BornToBeRoot
Copy link
Owner

Hi,

can you run this build to get the NetworkInterfaceType. It should display a messagebox.

image

The build is based on the last release, so you need .NET 5.0 Desktop to run it.

Download (via nextcloud, because it's too large for the comments ;( )

https://cloud.borntoberoot.net/s/fAHAqLPCe8twRLG
PW: 2020Issue#375

@wolph
Copy link
Author

wolph commented Dec 13, 2020

I'm not able to download it unfortunately
image

@BornToBeRoot
Copy link
Owner

BornToBeRoot commented Dec 13, 2020

LOL. Does work on my pc ^^

Did you enter the password and hit enter? Dont click on "Request password"

@wolph
Copy link
Author

wolph commented Dec 13, 2020

You're right. I absent-mindedly clicked on the button :P

It shows this messagebox 2 times:
image
Followed by this one:
image

@BornToBeRoot
Copy link
Owner

Great! In .NET the interfacetype 53 is not available as enum.
So i was unsure if it is int 53 or NetworkInterfaceType.Unkown.

Here is the fix if you want to try it out and test if it works.

https://cloud.borntoberoot.net/s/6EXtsNtqmbzNR6Y
PW: 2020Issue#375

PR: #394

It will be available in the next release!

BornToBeRoot added a commit that referenced this issue Dec 14, 2020
* NetworkInterfaceType 53 added - Close #375

* Close #390

* Code improved, documentation added

Co-authored-by: BornToBeRoot <[email protected]>
@wolph
Copy link
Author

wolph commented Dec 14, 2020

Working great! Thank you :)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants