Subject: Re: bin/581: small bug in telnet src
To: Brian D. Carlstrom <bdc@jolt.mit.edu>
From: matthew green <mrg@mame.mu.OZ.AU>
List: netbsd-bugs
Date: 11/21/1994 19:34:34
   
   >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

setsockopt(2) says

     int
     setsockopt(int s, int level, int optname, const void *optval, int optlen)

i'd suggest making togdebug() like

static int
togdebug()
{
    if (net > 0 && setsockopt(net, SOL_SOCKET, SO_DEBUG, (void *) &debug, sizeof(debug)) < 0)
	perror("setsockopt (SO_DEBUG)");
    return 1;
}

maybe.

.mrg.