From owner-freebsd-bugs Thu Jan 25 1: 0:23 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4ACF737B404 for ; Thu, 25 Jan 2001 01:00:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0P901X86421; Thu, 25 Jan 2001 01:00:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E0D5737B402 for ; Thu, 25 Jan 2001 00:50:06 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0P8o6H85568; Thu, 25 Jan 2001 00:50:06 -0800 (PST) (envelope-from nobody) Message-Id: <200101250850.f0P8o6H85568@freefall.freebsd.org> Date: Thu, 25 Jan 2001 00:50:06 -0800 (PST) From: brandt@fokus.gmd.de To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/24629: ng_socket failes to declare connected data sockets as connected. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 24629 >Category: kern >Synopsis: ng_socket failes to declare connected data sockets as connected. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 25 01:00:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Harti Brandt >Release: CURRENT >Organization: GMD Fokus >Environment: FreeBSD beagle.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Wed Jan 24 10:15:13 CET 2001 hbb@beagle.fokus.gmd.de:/opt/obj/usr/src/sys/BEAGLE i386 >Description: According to the ng_socket man page it should be possible to use naive programs with ng_socket data sockets. This requires, that read() and write() should work on these sockets. When using write(), the error code EDESTADDRREQ is returned. An inspection of the libnetgraph code shows, that connect() is called on the data socket. That means the kernel should know the destination. There are only two places in /sys/kern and /sys/netgraph where the EDESTADDRREQ is retured: in the generic sosend() and in ng_socket. A further inspection shows, that the error in this case is returned by the generic layer, because it thinks, that the socket is not connected. >How-To-Repeat: Create a socket node and connected it to ONE arbitrary netgraph hook, that accepts data. Use write(2) to write to the data socket. Observe the returned error code. >Fix: ng_connect_data should set the SS_CONNECTED flag on the socket. Either by calling soisconnected() or by directly setting the flag. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message