From owner-freebsd-net@FreeBSD.ORG Sat Jun 5 01:44:10 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 689CC16A4CE for ; Sat, 5 Jun 2004 01:44:10 -0700 (PDT) Received: from volt.iem.pw.edu.pl (volt.iem.pw.edu.pl [194.29.146.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id C4EE943D2D for ; Sat, 5 Jun 2004 01:44:09 -0700 (PDT) (envelope-from brudnya@volt.iem.pw.edu.pl) Received: from volt.iem.pw.edu.pl (brudnya@localhost [127.0.0.1]) by volt.iem.pw.edu.pl (8.12.11/8.12.9) with ESMTP id i558hUQ0037018 for ; Sat, 5 Jun 2004 10:43:30 +0200 (CEST) (envelope-from brudnya@volt.iem.pw.edu.pl) Received: from localhost (brudnya@localhost)i558hU0f037015 for ; Sat, 5 Jun 2004 10:43:30 +0200 (CEST) (envelope-from brudnya@volt.iem.pw.edu.pl) Date: Sat, 5 Jun 2004 10:43:30 +0200 (CEST) From: Adam Brudny To: Message-ID: <20040605104220.P36977-100000@volt.iem.pw.edu.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Probelm setting socket options? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2004 08:44:10 -0000 Hi guys! I'm a quite newbe in sock API so please be patient :) I've seen quite a lot of log entries in my smbd.log file like that: Apr 29 00:42:09 host smbd[45372]: Failed to set socket option TCP_NODELAY (Error Connection reset by peer) I've tried to track it with truss (result below). My question is - does the setsockopt() fails BECAUSE the socket is not connected anymore (client closed it before setting the option) or the connection fails, and the client disconnects BECAUSE TCP_NODELAY option couldn't have been set properly ??? How to know that? ajb # truss -f -p PID 1654: fork() = 83030 (0x14456) 83030: close(18) = 0 (0x0) 83030: close(19) = 0 (0x0) 83030: close(0) = 0 (0x0) 83030: close(1) = 0 (0x0) 83030: open("/dev/null",0x2,00) = 0 (0x0) 83030: open("/dev/null",0x2,00) = 1 (0x1) 83030: setsockopt(0x17,0xffff,0x8,0xbfbfd99c,0x4) = 0 (0x0) 83030: setsockopt(0x17,0x6,0x1,0xbfbfd99c,0x4) ERR#54 'Connection reset by peer' 83030: gettimeofday(0xbfbfc428,0x0) = 0 (0x0) 83030: getpid() = 83030 (0x14456) 83030: sendto(0x5,0xbfbfc8c0,0,0x0,NULL,0x0) = 106 (0x6a) 83030: geteuid() = 0 (0x0) 83030: fstat(22,0xbfbfd0a0) = 0 (0x0) 83030: getpeername(0x17,0xbfbfdaa0,0xbfbfda9c) ERR#57 'Socket is not connected' ... ....