Skip to content

Commit

Permalink
Merge pull request #287 from bastionplatforms/support-vsock-cid
Browse files Browse the repository at this point in the history
transport: Support passing CID for linux vsock
  • Loading branch information
openshift-ci[bot] authored Oct 19, 2023
2 parents 44a9667 + 45772d7 commit 6271c40
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 6271c40

Please sign in to comment.