From owner-freebsd-questions@FreeBSD.ORG Mon Mar 8 22:34:16 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E68616A4CE for ; Mon, 8 Mar 2004 22:34:16 -0800 (PST) Received: from ponoka.ed.shawcable.net (h68-148-55-101.ed.shawcable.net [68.148.55.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E53B43D31 for ; Mon, 8 Mar 2004 22:34:13 -0800 (PST) (envelope-from rdh@yottayotta.com) Received: from ponoka.ed.shawcable.net (localhost [127.0.0.1]) i296YCU6097080; Mon, 8 Mar 2004 23:34:12 -0700 (MST) (envelope-from rdh@yottayotta.com) Received: (from rdh@localhost) by ponoka.ed.shawcable.net (8.12.9p2/8.12.9/Submit) id i296YCAv097079; Mon, 8 Mar 2004 23:34:12 -0700 (MST) (envelope-from rdh@yottayotta.com) X-Authentication-Warning: ponoka.ed.shawcable.net: rdh set sender to rdh@yottayotta.com using -f To: freebsd-questions@freebsd.org From: Dale Hagglund Date: Mon, 08 Mar 2004 23:34:12 -0700 Message-ID: <86smgizfyz.fsf@ponoka.ed.shawcable.net> User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: change in semantics of socket(PF_INET, SOCK_STREAM, 0)? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2004 06:34:16 -0000 I upgraded from 4.8 to 4.9 and my install of net/vnc couldn't connect to a remote server any more. The connection is via an ssh tunnel, but I don't think that's relevant. The interesting thing was that I *could* connect to the local end of the tunnel via telnet, but not via vnc. A few ktraces later, I got the following partial dumps: telnet: 88320 telnet CALL socket(0x2,0x1,0x6) 88320 telnet RET socket 3 88320 telnet CALL connect(0x3,0x8069020,0x10) 88320 telnet RET connect 0 vncviewer: 80280 vncviewer CALL socket(0x2,0x1,0) 80280 vncviewer RET socket 4 80280 vncviewer CALL connect(0x4,0xbfbff630,0x10) For vncviewer, the connect is the last call in the trace. If I leave it long enough, the connection times out. A bit of decoding (and source code inspection) gives the following C equivalents: telnet: socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) vncviewer: socket(PF_INET, SOCK_STREAM, 0) When I check ip(4), I find that a _proto_ argument of zero implies IPPROTO_RAW. Since vnc used to work before, I'm guessing this has changed sometime recently. However, tcp(4) still gives the exact same call used by vncviewer in its SYNOPSIS section; ditto for udp(4). Anyway, I guess the basic question is whether or not this change in the semantics of socket(2) was intended. In either case, I can submit an appropriate PR if that will help. Dale Hagglund