Skip to content

Commit

Permalink
transport: Support passing CID for linux vsock
Browse files Browse the repository at this point in the history
  • Loading branch information
jalaziz committed Oct 19, 2023
1 parent 44a9667 commit ad05797
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/transport/listen_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ func listenURL(parsed *url.URL) (net.Listener, error) {
if err != nil {
return nil, err
}

if parsed.Hostname() != "" {
cid, err := strconv.Atoi(parsed.Hostname())
if err != nil {
return nil, err
}
return mdlayhervsock.ListenContextID(uint32(cid), uint32(port), nil)
}

return mdlayhervsock.Listen(uint32(port), nil)
case "unixpacket":
return net.Listen(parsed.Scheme, parsed.Path)
Expand Down

0 comments on commit ad05797

Please sign in to comment.