WireGuard Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 2/2] Bubble up the error in attempting to delete the interface after attempting to set the interface name has failed.
       [not found] <20190521081648.12160-1-jwriteclub@gmail.com>
@ 2019-05-21  8:16 ` jwriteclub
  2019-06-06 10:15   ` Jason A. Donenfeld
  0 siblings, 1 reply; 2+ messages in thread
From: jwriteclub @ 2019-05-21  8:16 UTC (permalink / raw)
  To: wireguard

From: Christopher O'Connell <jwriteclub@gmail.com>

---
 tun/tun_windows.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index c1c7de7..6d79ba9 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -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)
 	}
 
-- 
2.21.0.windows.1

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] Bubble up the error in attempting to delete the interface after attempting to set the interface name has failed.
  2019-05-21  8:16 ` [PATCH 2/2] Bubble up the error in attempting to delete the interface after attempting to set the interface name has failed jwriteclub
@ 2019-06-06 10:15   ` Jason A. Donenfeld
  0 siblings, 0 replies; 2+ messages in thread
From: Jason A. Donenfeld @ 2019-06-06 10:15 UTC (permalink / raw)
  To: Christopher O'Connell; +Cc: WireGuard mailing list

Thanks, I'll apply this. But can you resubmit with a proper
signed-off-by line (git commit -s) and a commit message that meets the
format of all the other ones touching that file?

Jason
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190521081648.12160-1-jwriteclub@gmail.com>
2019-05-21  8:16 ` [PATCH 2/2] Bubble up the error in attempting to delete the interface after attempting to set the interface name has failed jwriteclub
2019-06-06 10:15   ` Jason A. Donenfeld

WireGuard Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ https://lore.kernel.org/wireguard \
		wireguard@lists.zx2c4.com zx2c4-wireguard@archiver.kernel.org
	public-inbox-index wireguard


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/com.zx2c4.lists.wireguard


AGPL code for this site: git clone https://public-inbox.org/ public-inbox