On Wed, Aug 19, 2015 at 01:29:27PM -0400, Mike Frysinger wrote:
> Currently the code assumes the set of valid options between getsockopt
> and setsockopt are exactly the same and thus maintains one list.  The
> kernel unfortunately does not do this -- it allows for different opts
> between the get and set functions.  See the {g,s}et_opt{min,max} fields
> in the various netfilter subcores.
> 
> To support this, extend the printxval function to take multiple sets of
> xlats as varargs.  Then we add the new get/set lists, and pass them down
> in the net code when decoding things.
> 
> A simple example is iptables; before:
>       getsockopt(4, SOL_IP, 0x40 /* IP_??? */, ...) = 0
>       getsockopt(4, SOL_IP, 0x41 /* IP_??? */, ...) = 0
> after:
>       getsockopt(4, SOL_IP, IPT_SO_GET_INFO, ...) = 0
>       getsockopt(4, SOL_IP, IPT_SO_GET_ENTRIES, ...) = 0
> 
> If these were setsockopt calls, then 0x40 & 0x41 would be
> IPT_SO_SET_REPLACE & IPT_SO_SET_ADD_COUNTERS.

Ideally, we also need a test for this, something like ip_mreq.test

> * util.c (printxval): Rename to ...
> (printxvals): ... this.  Rewrite to be varargs based.

OK, let's have two separate functions so that
the most frequent use case won't be penalized.


-- 
ldv

Attachment: pgpAhWvao4p_w.pgp
Description: PGP signature

------------------------------------------------------------------------------
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to