Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for ncat --vsock -l <port> #2807

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stefano-garzarella
Copy link

@stefano-garzarella stefano-garzarella commented Mar 20, 2024

Commit 04c4c70 ("Support decimal integer representation of target addresses. Fixes #375") introduced a regression when the user specify only the port using AF_VSOCK in listening (e.g. ncat --vsock -l 1234).

Before that commit we supported this invocation, but currently we interpret the parameter as CID. Alternatively, the version with -p is still working (e.g. ncat --vsock -l -p 1234).

Having documented this usage in the manpage as well, it's better to fix it and support it again.

Tested locally (without VMs involved), using CID = 1 (loopback) in this way:

shell1$ ncat --vsock -l 1234

shell2$ ncat --vsock 1 1234

# Note: If CID 1 is not supported and the previous command fails,
# it means that you have to manually load `vsock_loopback` kernel
# module (usually it is autoamtically loaded when AF_VSOCK is used
# if the `vsock` kernel module is not already loaded in the system)

Reported-by: Luigi Leonardi [email protected]

Commit 04c4c70 ("Support decimal integer representation of target
addresses. Fixes nmap#375") introduced a regression when the user specifies
only the port using AF_VSOCK in listening (e.g. `ncat --vsock -l 1234`).

Before that commit, we supported this invocation, but currently we
interpret the parameter as CID. Alternatively, the version with -p is
still working (e.g. `ncat --vsock -l -p 1234`).

Having documented this usage in the manpage as well, it's better to fix
it and support it again.

Tested locally (without VMs involved), using CID = 1 (loopback) in this
way:

    shell1$ ncat --vsock -l 1234

    shell2$ ncat --vsock 1 1234

    # Note: If CID 1 is not supported and the previous command fails,
    # it means that you have to manually load `vsock_loopback` kernel
    # module (usually it is autoamtically loaded when AF_VSOCK is used
    # if the `vsock` kernel module is not already loaded in the system)

Reported-by: Luigi Leonardi <[email protected]>
Signed-off-by: Stefano Garzarella <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support decimal-IP notation for destination in Ncat
1 participant