From owner-svn-src-head@freebsd.org Tue May 16 20:08:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41967D70DCE; Tue, 16 May 2017 20:08:56 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C95BDD9; Tue, 16 May 2017 20:08:56 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2003:cd:6bc9:d100:a4e8:994e:c9c6:cc3d] (p200300CD6BC9D100A4E8994EC9C6CC3D.dip0.t-ipconnect.de [IPv6:2003:cd:6bc9:d100:a4e8:994e:c9c6:cc3d]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 85C18721E2825; Tue, 16 May 2017 22:08:51 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317732 - head/usr.bin/truss From: Michael Tuexen In-Reply-To: <1678847.Pdl09MfElI@ralph.baldwin.cx> Date: Tue, 16 May 2017 22:08:50 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6E31B0EF-74B4-4D9A-8126-1161AEF4F3CE@freebsd.org> References: <201705030923.v439NEWv072629@repo.freebsd.org> <1678847.Pdl09MfElI@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 May 2017 20:08:56 -0000 > On 16. May 2017, at 20:28, John Baldwin wrote: >=20 > On Wednesday, May 03, 2017 09:23:14 AM Michael Tuexen wrote: >> Author: tuexen >> Date: Wed May 3 09:23:13 2017 >> New Revision: 317732 >> URL: https://svnweb.freebsd.org/changeset/base/317732 >>=20 >> Log: >> Decode the third argument of socket(). >=20 > This is not quite right for sockets that aren't PF_INET. Probably = this > warrants a const char *sysdecode_socket_protocol(int domain, int = protocol) > that honors the domain in deciding what protocol value to output. For = now > this could just handle PF_INET: >=20 > const char * > sysdecode_socket_protocol(int domain, int protocol) > { >=20 > switch (domain) { > case PF_INET: > return (lookup_value(sockipproto, protocol)); > default: > return (NULL)); > } >=20 > Then use this in truss. Yes, you are right. Will fix this tomorrow. Best regards Michael >=20 > The socket option stuff currently hardcodes IP protocols and levels = only > because we don't have a good way of obtaining the domain of an = existing > socket in a target process. For socket()'s protocol argument though = we > readily have the domain available. >=20 > At some point in the future we might address the socket option issue = by > caching the domain argument when sockets are created in a table, and = for > truss when attaching to an existing process using the kinfo_file = interface to > learn about existing sockets, but that's not entirely trivial. >=20 > --=20 > John Baldwin