Skip to contentSkip to conversation

Bubble up the error in attempting to delete the interface after attempting to set the interface name has failed.

PATCH In review [email protected] 2 participants 2 messages Jun 6, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/2 Bubble up the error in attempting to delete the interface after attempting to set the interface name has failed.

From: Christopher O'Connell <[email protected]>

---
 tun/tun_windows.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tun/tun_windows.go +4 -1
index c1c7de7..6d79ba9 100644
@@ -79,7 +79,10 @@ func CreateTUN(ifname string) (TUNDevice, error) {
 
 	err = wt.SetInterfaceName(ifname)
 	if err != nil {
-		wt.DeleteInterface(0)
+		_, _, err2 := wt.DeleteInterface(0)
+		if err2 != nil {
+			return nil,fmt.Errorf("Unable to delete Wintun interface after failing to set name: %v: %v", err2, err)
+		}
 		return nil, fmt.Errorf("Unable to set name of Wintun interface: %v", err)
 	}
 
Signature · 6 lines
2.21.0.windows.1

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard