From owner-freebsd-net@FreeBSD.ORG Thu Aug 29 18:48:48 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CC946556 for ; Thu, 29 Aug 2013 18:48:48 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id 9D852205A for ; Thu, 29 Aug 2013 18:48:48 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id r7TImf61093538 for ; Thu, 29 Aug 2013 11:48:42 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <521F9789.5000903@rawbw.com> Date: Thu, 29 Aug 2013 11:48:41 -0700 From: Yuri User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130822 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: LOCAL_CREDS are broken ? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2013 18:48:48 -0000 The example below breaks with "Protocol not available" But what is wrong? Isn't this the correct usage? LOCAL_CREDS are only handled in kern/uipc_usrreq.c for AF_LOCAL, so it isn't clear why this doesn't work. Yuri --- example.c --- #include #include #include #include #include main() { int sock; int error; int oval = 1; error = socket(AF_LOCAL, SOCK_SEQPACKET, 0); if (error == -1) {perror("socket"); exit(-1);} sock = error; error = setsockopt(sock, SOL_SOCKET, LOCAL_CREDS, &oval, sizeof(oval)); if (error) {perror("setsockopt"); exit(-1);} }