Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 May 2017 22:08:50 +0200
From:      Michael Tuexen <tuexen@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r317732 - head/usr.bin/truss
Message-ID:  <6E31B0EF-74B4-4D9A-8126-1161AEF4F3CE@freebsd.org>
In-Reply-To: <1678847.Pdl09MfElI@ralph.baldwin.cx>
References:  <201705030923.v439NEWv072629@repo.freebsd.org> <1678847.Pdl09MfElI@ralph.baldwin.cx>

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

> On 16. May 2017, at 20:28, John Baldwin <jhb@freebsd.org> wrote:
> 
> 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
>> 
>> Log:
>>  Decode the third argument of socket().
> 
> 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:
> 
> const char *
> sysdecode_socket_protocol(int domain, int protocol)
> {
> 
>    switch (domain) {
>        case PF_INET:
>            return (lookup_value(sockipproto, protocol));
>        default:
>            return (NULL));
> }
> 
> Then use this in truss.
Yes, you are right. Will fix this tomorrow.

Best regards
Michael
> 
> 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.
> 
> 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.
> 
> -- 
> John Baldwin




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6E31B0EF-74B4-4D9A-8126-1161AEF4F3CE>