Skip to content

Flagless host:port binds a server and silently discards the host #21

Description

@jeonghanlee

Flagless host:port binds a server and silently discards the host

Milestone

Backlog

Labels

bug, P3-low, area/uds

Summary

A flagless host:port target that does not start with : is auto-classified as a server: con.cpp:591-593 sets srv_flag = true (the comment there reads "most probably client"), the server TCP branch binds INADDR_ANY and discards the host prefix. So con example.com:8080 opens a listening socket on 8080 rather than connecting outbound, contrary to the telnet host port / nc host port convention a user expects.

Root Cause

con.cpp:591-593 (comment-vs-code mismatch); server TCP branch drops the host (con.cpp:715, 734, 744).

Proposed Fix (decision needed)

Decide the default direction for a flagless contained-colon target: flip to client (matches convention; behavior change for an undocumented form), optionally with a one-line stderr note; or require explicit -c/-s. The leading-colon :port server form stays.

Acceptance Criteria

  • The flagless host:port behavior is defined intentionally and documented, not left as a comment/code contradiction.

Out of Scope

The UNIX-vs-TCP colon misrouting (M1/#4). M1 only aligns the comment to the current code; this issue decides whether the behavior itself should change.

Surfaced during the M1 (#4) review session, 2026-06-22.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions