mirror of
https://repo.or.cz/socat.git
synced 2025-07-29 13:42:58 +00:00
Added VSOCK stream addresses
This commit is contained in:
parent
1c7ddfef73
commit
1502f0cdcb
18 changed files with 442 additions and 4 deletions
12
xio-listen.c
12
xio-listen.c
|
@ -152,6 +152,18 @@ int _xioopen_listen(struct single *xfd, int xioflags, struct sockaddr *us, sockl
|
|||
applyopts_offset(xfd, opts);
|
||||
applyopts_cloexec(xfd->fd, opts);
|
||||
|
||||
#if defined(WITH_VSOCK) && defined(IOCTL_VM_SOCKETS_GET_LOCAL_CID)
|
||||
{
|
||||
unsigned int cid;
|
||||
if (Ioctl(xfd->fd, IOCTL_VM_SOCKETS_GET_LOCAL_CID, &cid) < 0) {
|
||||
Warn2("ioctl(%d, IOCTL_VM_SOCKETS_GET_LOCAL_CID, ...): %s",
|
||||
xfd->fd, strerror(errno));
|
||||
} else {
|
||||
Notice1("VSOCK CID=%u", cid);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
applyopts(xfd->fd, opts, PH_PREBIND);
|
||||
applyopts(xfd->fd, opts, PH_BIND);
|
||||
if (Bind(xfd->fd, (struct sockaddr *)us, uslen) < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue