There were 3 related bugs here:
1. The same report_sock call would sometimes print information about
the peer socket and sometimes about the local socket. This
confusion may have been enabled by its duplicitous API. This is
fixed by dropping the path parameter and renaming it to
report_addr. Additionally, a new report_sock is added which first
obtains the address for the given socket and then calls
2. In the case of "uflag && !kflag" branch of a listening socket there
was a call to report_sock which neglected to adjust the argument
depending on the address family: unix sockets would cause netcat to
3. report_sock printed awkward messages because it always tacked "on"
to the user-provided message, even though sometimes a different
preposition was needed. This is fixed by no longer adding anything
to the user message.