Network order or Host order for raw xlat style

shankarapailoor shankarapailoor at gmail.com
Fri Jan 4 07:13:39 UTC 2019


Hi again,

I've added support to properly handle xlat styles when decoding both
sockaddr_in6 (sin6_port, sin6_addr, sin6_flowinfo) as well as
sockaddr_in (sin_port, sin_addr). I merged the two into one patch
which is attached. Let me know what you all think!

Regards,
Shankara

P.S. Happy New Year!

On Wed, Jan 2, 2019 at 1:33 PM shankarapailoor
<shankarapailoor at gmail.com> wrote:
>
> Hi,
>
> Attached is a patch to handle xlat_styles for sin_port and sin_addr
> fields in sockaddr_in decoding. Let me know what you all think.
>
> Regards,
> Shankara
>
> On Wed, Jan 2, 2019 at 10:24 AM Eugene Syromiatnikov <esyr at redhat.com> wrote:
> >
> > On Wed, Jan 02, 2019 at 10:19:46AM -0800, shankarapailoor wrote:
> > > Hi,
> > >
> > > strace currently decodes sockaddr fields of sin_port and sin_addr in
> > > macro form of htonl(X) and inet_addr("Y") even when using -Xraw which
> > > seems wrong. I'm working on fixing this but I wonder: should the raw
> > > value of these fields should be the network ordered value or host
> > > ordered value?
> >
> > htonl() is used precisely for signifying byte order. If there's not such
> > sign, host order is assumed. The same for inet_addr().
> >
> > As an alternative, the data in question can be printed as a hex string
> > or a byte array.
> >
> > > Regards,
> > > Shankara Pailoor
> > > --
> > > Strace-devel mailing list
> > > Strace-devel at lists.strace.io
> > > https://lists.strace.io/mailman/listinfo/strace-devel
> > --
> > Strace-devel mailing list
> > Strace-devel at lists.strace.io
> > https://lists.strace.io/mailman/listinfo/strace-devel
>
>
>
> --
> Regards,
> Shankara Pailoor



-- 
Regards,
Shankara Pailoor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-0001-handle-xlat-styles-when-decoding-sockaddr_in-and-.patch
Type: text/x-patch
Size: 14915 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190103/d85046a5/attachment.bin>


More information about the Strace-devel mailing list