NetBSD Problem Report #581

From gnats  Sun Nov 20 13:34:46 1994
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id NAA04409 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Sun, 20 Nov 1994 13:34:46 -0800
Message-Id: <199411202136.QAA12495@fnord.mit.edu>
Date: Sun, 20 Nov 1994 16:36:11 -0500
From: "Brian D. Carlstrom" <bdc@JOLT.MIT.EDU>
Reply-To: bdc@ai.mit.edu
To: gnats-bugs@NetBSD.ORG
Subject: small bug in telnet src
X-Send-Pr-Version: 3.2

>Number:         581
>Category:       bin
>Synopsis:       small bug in telnet src
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 20 13:35:03 +0000 1994
>Closed-Date:    Tue Jan 03 06:24:56 +0000 1995
>Last-Modified:  
>Originator:     Brian D. Carlstrom
>Release:        1.0
>Organization:
"MIT AI Lab	"
>Environment:

System: NetBSD fnord.mit.edu 1.0 NetBSD 1.0 (FNORD) #0: Fri Oct 21 15:03:57 EDT 1994 bdc@fnord.mit.edu:/usr/src/sys/arch/i386/compile/FNORD i386


>Description:

In a part of the telnet/commands.c file, an ifdef'ed out part of the
code for pre-4.3 systems has a incorrect number of arguments, probably
because they used the sugary SetSockOpt when they wanted setsockopt.

>How-To-Repeat:

look below line 494, given below. the #else part has a SetSockOpt that
takes 5 arguments, when it takes 4. however, setsockopt would make
sense there i believe:

    static int
togdebug()
{
#ifndef	NOT43
    if (net > 0 &&
	(SetSockOpt(net, SOL_SOCKET, SO_DEBUG, debug)) < 0) {
	    perror("setsockopt (SO_DEBUG)");
    }
#else	/* NOT43 */
    if (debug) {
	if (net > 0 && SetSockOpt(net, SOL_SOCKET, SO_DEBUG, 0, 0) < 0)
	    perror("setsockopt (SO_DEBUG)");
    } else
	printf("Cannot turn off socket debugging\n");
#endif	/* NOT43 */
    return 1;
}

>Fix:

change the like to be "SetSockOpt(net,SOL_SOCKET,SO_DEBUG,1)" (to turn it on),
or change it to "setsockopt(net,SOL_SOCKET,SO_DEBUG,0,0) to just use the
straight syscall...like i saidm this code doesnt seem to be in use really or this would have been found easily. stumbled on it looking for SockOpt examples

-bri
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: hpeyerl 
State-Changed-When: Mon Jan 2 22:24:56 PST 1995 
State-Changed-Why:  
Cuz I was bored and going through the PR database. Fixed call to SetSockOpt 
as per bdc. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.