[PATCH v4 05/11] tests: fix TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY use for large objects
Dmitry V. Levin
ldv at altlinux.org
Mon Jul 10 10:36:30 UTC 2017
On Thu, Jul 06, 2017 at 10:58:59PM +0800, JingPiao Chen wrote:
> On Thu, Jul 06, 2017 at 02:48:51PM +0300, Dmitry V. Levin wrote:
> > On Thu, Jul 06, 2017 at 09:57:31AM +0800, JingPiao Chen wrote:
> > > commit v4.17-161-gdbd0605 adjust TEST_NLATTR_OBJECT and
> > > TEST_NLATTR_ARRAY for large objects, only change the pattern
> > > print length, still pass a big length for nla_data_len, do not
> > > change strace output, still output '"STR"...'.
> > >
> > > * tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY):
> > > In case of len < sizeof(object), pass plen as nla_data_len and slen.
> > > ---
> > > tests/test_nlattr.h | 6 ++----
> > > 1 file changed, 2 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/tests/test_nlattr.h b/tests/test_nlattr.h
> > > index 9c15c33..4a2af02 100644
> > > --- a/tests/test_nlattr.h
> > > +++ b/tests/test_nlattr.h
> > > @@ -108,8 +108,7 @@ print_nlattr(const unsigned int nla_len, const char *const nla_type)
> > > TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
> > > (init_msg_), (print_msg_), \
> > > (nla_type_), #nla_type_, \
> > > - sizeof(obj_) - 1, \
> > > - (pattern_), sizeof(obj_) - 1, \
> > > + plen, (pattern_), plen, \
> > > print_quoted_hex((pattern_), plen)); \
> > > /* short read of sizeof(obj_) */ \
> > > TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
> > > @@ -139,8 +138,7 @@ print_nlattr(const unsigned int nla_len, const char *const nla_type)
> > > TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
> > > (init_msg_), (print_msg_), \
> > > (nla_type_), #nla_type_, \
> > > - sizeof((obj_)[0]) - 1, \
> > > - (pattern_), sizeof((obj_)[0]) - 1, \
> > > + plen, (pattern_), plen, \
> > > print_quoted_hex((pattern_), plen)); \
> > > /* sizeof((obj_)[0]) < len < sizeof(obj_) */ \
> > > TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
> >
> > I don't see why this change is needed. I thought it's fine to pass an
> > object larger than plen as long as it's smaller than expected by strace.
>
> I think you can apply [PATCH v4 03/11], [PATCH v4 04/11]
> and [PATCH v4 06/11] to see what happen, test log above:
>
> -{{nla_len=47, nla_type=PACKET_DIAG_MCLIST}, "abcdefghijklmnopqrstuvwxyzabcdef"}}
> +{{nla_len=47, nla_type=PACKET_DIAG_MCLIST}, "abcdefghijklmnopqrstuvwxyzabcdef"...}}
OK, applied.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170710/876a8fb9/attachment.bin>
More information about the Strace-devel
mailing list