summaryrefslogtreecommitdiffhomepage
path: root/tun/wintun/wintun_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-02-07 19:42:59 +0100
committerSimon Rozman <simon@rozman.si>2019-02-07 19:42:59 +0100
commitef48d4fa957f0ae7db3e9ad51c0d443ccc410588 (patch)
tree26d5b841c57a8050b987395c11d604ea78f252fc /tun/wintun/wintun_windows.go
parentf7276ed522dd31ef427ec939ed2dc3af32071974 (diff)
wintun: Explain rationale behind case-insensitive interface names
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'tun/wintun/wintun_windows.go')
-rw-r--r--tun/wintun/wintun_windows.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/tun/wintun/wintun_windows.go b/tun/wintun/wintun_windows.go
index b7d84fa..c1ffb17 100644
--- a/tun/wintun/wintun_windows.go
+++ b/tun/wintun/wintun_windows.go
@@ -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.