diff options
author | harti <harti@FreeBSD.org> | 2003-08-13 10:56:40 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-08-13 10:56:40 +0000 |
commit | b61072d98732601cd5f925936673d249a5cb5b99 (patch) | |
tree | 7dc8b2d3f8c5867fa69bd8591b4627f2e421847c /contrib/telnet/telnetd | |
parent | 45f9ef9ca4a4369cc93d9a6b72d979f8ff519da4 (diff) | |
download | FreeBSD-src-b61072d98732601cd5f925936673d249a5cb5b99.zip FreeBSD-src-b61072d98732601cd5f925936673d249a5cb5b99.tar.gz |
Implement what has been documented for a long time: make -debug switch
on socket debugging.
Okay'ed by: markm
Diffstat (limited to 'contrib/telnet/telnetd')
-rw-r--r-- | contrib/telnet/telnetd/telnetd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/telnet/telnetd/telnetd.c b/contrib/telnet/telnetd/telnetd.c index bdb76d7..1189574 100644 --- a/contrib/telnet/telnetd/telnetd.c +++ b/contrib/telnet/telnetd/telnetd.c @@ -348,6 +348,9 @@ main(int argc, char *argv[]) err(1, "socket"); (void) setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)); + if (debug > 1) + (void) setsockopt(s, SOL_SOCKET, SO_DEBUG, + (char *)&on, sizeof(on)); if (bind(s, res->ai_addr, res->ai_addrlen) < 0) err(1, "bind"); if (listen(s, 1) < 0) @@ -356,6 +359,8 @@ main(int argc, char *argv[]) ns = accept(s, res->ai_addr, &foo); if (ns < 0) err(1, "accept"); + (void) setsockopt(ns, SOL_SOCKET, SO_DEBUG, + (char *)&on, sizeof(on)); (void) dup2(ns, 0); (void) close(ns); (void) close(s); |