]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
wintun: Explain rationale behind case-insensitive interface names
authorSimon Rozman <simon@rozman.si>
Thu, 7 Feb 2019 18:42:59 +0000 (19:42 +0100)
committerSimon Rozman <simon@rozman.si>
Thu, 7 Feb 2019 18:42:59 +0000 (19:42 +0100)
Signed-off-by: Simon Rozman <simon@rozman.si>
tun/wintun/wintun_windows.go

index b7d84fa9ffb36e3464beb5baf08c7801f07a1860..c1ffb1716ee214465d96e231dbb70a8c9d216c39 100644 (file)
@@ -52,7 +52,11 @@ func GetInterface(ifname string, hwndParent uintptr) (*Wintun, error) {
                return nil, err
        }
 
-       // TODO: If we're certain we want case-insensitive name comparison, please document the rationale.
+       // Windows requires each interface to have a different name. When
+       // enforcing this, Windows treats interface names case-insensitive. If an
+       // interface "FooBar" exists and this function reports there is no
+       // interface "foobar", an attempt to create a new interface and name it
+       // "foobar" would cause conflict with "FooBar".
        ifname = strings.ToLower(ifname)
 
        // Iterate.