Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jan 2001 00:50:06 -0800 (PST)
From:      brandt@fokus.gmd.de
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/24629: ng_socket failes to declare connected data sockets as connected.
Message-ID:  <200101250850.f0P8o6H85568@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101250850.f0P8o6H85568>