From 184fa38903940a086fe2f90441e9539b7e22f0f2 Mon Sep 17 00:00:00 2001 From: David Scott Date: Fri, 15 Apr 2016 17:07:52 +0100 Subject: [PATCH] diagnostics: listen on both TCP/IP and vsock ports The TCP/IP port will be used by Windows, while Mac can use the vsock one. Signed-off-by: David Scott --- alpine/packages/diagnostics/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/alpine/packages/diagnostics/main.go b/alpine/packages/diagnostics/main.go index ae6dbc502..8094aa391 100644 --- a/alpine/packages/diagnostics/main.go +++ b/alpine/packages/diagnostics/main.go @@ -10,6 +10,7 @@ import ( "path" "strings" "time" + "github.com/djs55/vsock" ) func run(timeout time.Duration, w *tar.Writer, command string, args ...string) { @@ -108,6 +109,12 @@ func main() { } else { listeners = append(listeners, ip) } + vsock, err := vsock.Listen(uint(62374)) + if err != nil { + log.Printf("Failed to bind to vsock port 62374: %#v", err) + } else { + listeners = append(listeners, vsock) + } for _, l := range listeners { go func(l net.Listener) {