liranringel / ipconfig

Get network adapters information for windows (written in Rust).
Apache License 2.0
38 stars 15 forks source link

On get_search_list returns extra first result #14

Closed glademiller closed 6 years ago

glademiller commented 6 years ago

get_search_list is returning

["lan ad.x.com other.com", "lan", "ad.x.com", "other.com"]

Looking at adaptor properties the first entry doesn't appear but the other three do. The spaces in the first entry cause issues upstream in trust_dns_proto.

This is on Windows 10.

glademiller commented 6 years ago

This might not be an issue opening up the registry key shows the first entry as well. Is this an edge case that needs to be handled or are the Windows machines at my office misconfigured?

liranringel commented 6 years ago

Could you write the value of SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\SearchList? It's supposed to be a comma separated string. Spaces are supposed to be invalid. If windows ignores the domains that contain spaces, I think we should adopt that behavior.

glademiller commented 6 years ago

The value was

lan ad.x.com other.com,lan,ad.x.com,other.com

So the code in the library is functioning as expected. The open question would be as the whether that is an incorrect configuration or something that needs to be handled. Looking at the search list in the network adaptor properties only shows the last 3 items. Yesterday I modified the registry to exclude the first item with no ill affects to the operating system.

liranringel commented 6 years ago

@glademiller it looks like a misconfiguration to me. When I run ipconfig.exe /all with your value (lan ad.x.com other.com,lan,ad.x.com,other.com) I get 6 values (and even lan twice!), and on ncpa.cpl I see that they parse everything before the first comma as 1 (only 4 values). I think the best thing to do is to leave the implementation the way it is.