]> granicus.if.org Git - strace/commit
nlattr: add ability to pass nla_type to decoder in decode_nlattr
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 7 May 2018 06:28:38 +0000 (08:28 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jun 2018 15:10:37 +0000 (15:10 +0000)
commitdbc5d26b29a15721884c53467fed16f30716e2f9
treeb2b2a4996d02449d42027a48475a1c83a18c9cb1
parent88d6b7287c5f61b6fb0ce1c337cf489150cf3172
nlattr: add ability to pass nla_type to decoder in decode_nlattr

As of now, it's impossible to introduce a dispatching nlattr decoder
that performs actions based on the type of the message, so let's use
a combination of zero decoder list size and non-zero decoder pointer
for this.

This is going to be used later in IFLA_AF_SPEC decoding.

* nlattr.c (decode_nlattr_with_data): Handle zero size and non-NULL
decoders in a special way.
(decode_nlattr): Add an error message about ignoring of opaque_data
argument when zero size and non-NULL decoders are provided.
* nlattr.h (decode_nlattr): Add a comment about the new special case.
nlattr.c
nlattr.h