From nobody@FreeBSD.org  Mon Feb 25 13:02:15 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id B9825E8F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 25 Feb 2013 13:02:15 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id AB2B7AF6
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 25 Feb 2013 13:02:15 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PD2Fog017012
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 25 Feb 2013 13:02:15 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r1PD2Fgv017011;
	Mon, 25 Feb 2013 13:02:15 GMT
	(envelope-from nobody)
Message-Id: <201302251302.r1PD2Fgv017011@red.freebsd.org>
Date: Mon, 25 Feb 2013 13:02:15 GMT
From: Nicholas Wilson <nicholas@nicholaswilson.me.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] incorrect errno for LOCAL_PEERCRED
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         176420
>Category:       kern
>Synopsis:       [kernel] [patch] incorrect errno for LOCAL_PEERCRED
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 25 13:10:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Wed Feb 27 00:19:53 UTC 2013
>Originator:     Nicholas Wilson
>Release:        Release 7.4 to Release 9.1
>Organization:
>Environment:
FreeBSD EB5-FBSD-7-4-x64.realvnc.ltd 7.4-RELEASE-p9 FreeBSD 7.4-RELEASE-p9 #0: Mon Jun 11 19:47:58 UTC 2012     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
A tiny bug; error code is incorrect for the SEQPACKET retrieval of LOCAL_PEERCRED.

* An unconnected SOCK_STREAM: get ENOTCONN
* A SOCK_DGRAM: get EINVAL
* An unconnected SOCK_SEQPACKET: get EINVAL, but should get ENOTCONN
>How-To-Repeat:

>Fix:
Patch attached for RELEASE-9.1

Patch attached with submission follows:

--- uipc_usrreq.c-9.1-release-r243808   2013-02-25 12:59:06.653391783 +0000
+++ uipc_usrreq.c       2013-02-25 13:00:43.196178074 +0000
@@ -1165,5 +1165,5 @@
                                xu = unp->unp_peercred;
                        else {
-                               if (so->so_type == SOCK_STREAM)
+                               if (so->so_proto->pr_flags & PR_CONNREQUIRED)
                                        error = ENOTCONN;
                                else

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Feb 27 00:19:39 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

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