From nobody@FreeBSD.org  Thu Jan 25 00:50:07 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id E0D5737B402
	for <freebsd-gnats-submit@FreeBSD.org>; 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
Subject: ng_socket failes to declare connected data sockets as connected.
X-Send-Pr-Version: www-1.0

>Number:         24629
>Category:       kern
>Synopsis:       ng_socket failes to declare connected data sockets as connected.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    harti
>State:          feedback
>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:  Fri Nov 16 04:13:40 UTC 2007
>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:
Responsible-Changed-From-To: freebsd-bugs->harti 
Responsible-Changed-By: arved 
Responsible-Changed-When: Wed Aug 25 16:13:08 GMT 2004 
Responsible-Changed-Why:  
A very old PR from harti, who probably knows best if this is still a  
problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24629 
State-Changed-From-To: open->feedback 
State-Changed-By: kmacy 
State-Changed-When: Fri Nov 16 04:13:12 UTC 2007 
State-Changed-Why:  

Need to confirm that this is still a problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24629 
>Unformatted:
