[PATCH v4 4/4] tests: add check for decoding of netfilter subsystem
chenjingpiao at gmail.com
Sun Mar 11 02:28:42 UTC 2018
On 03/11 05:02, Dmitry V. Levin wrote:
> On Sun, Mar 11, 2018 at 09:43:53AM +0800, Chen Jingpiao wrote:
> > On 03/11 03:48, Dmitry V. Levin wrote:
> > > In other words, NFNL_SUBSYS_COUNT provided by kernel headers is
> > > and shouldn't be used, I think it has to be removed from
> > > xlat/nl_netfilter_subsys_ids.in as well.
> > I can not find an existing way to remove the condition from xlat/*.h.
> > xlat/gen.sh only have print_xlat and cond_xlat to generate xlat array.
> > Should I add a directive?
> Well, you can simply write
> #undef NFNL_SUBSYS_COUNT
> #define NFNL_SUBSYS_COUNT 12
> but NFNL_SUBSYS_COUNT is not a symbol with some constant value: it changes
> with time, so what's the use of printing it in symbolic form?
If we want to print it well in symbolic form, we should use kernel headers'
NFNL_SUBSYS_COUNT value, and move it to the first line.
What do you think?
> > ps:
> > Is the same problem exist in other counter symbols in xlat/*.in?
> > (I do the research, not found.)
> I haven't investigated it. We might have more issues of this nature,
> but if we do, then they are not covered by tests.
> > > For netlink_netfilter.c purposes I'd recommend to use something like
> > > (subsys_id >
> > - 1].val)
> > > instead of subsys_id >= NFNL_SUBSYS_COUNT).
> > If I have removed kernel header's NFNL_SUBSYS_COUNT value from
> > xlat/nl_netfilter_subsys_ids.in.
> > Why can't we use subsys_id >= NFNL_SUBSYS_COUNT?
> I wonder whether it's a good idea to check against NFNL_SUBSYS_COUNT?
> Wouldn't it be more future-proof to invoke decode_nlattr for any
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Strace-devel