[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpWHq4G1s_UFG9ag2R+c6fOA9QddH+MNO2FLGkb4j2sHjg@mail.gmail.com>
Date: Wed, 23 Jan 2019 17:16:37 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Martin Olsson <martin.olsson+netdev@...torsecurity.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>, David Ahern <dsahern@...il.com>
Subject: Re: [Patch iproute2] tc: add hit counter for matchall
On Wed, Jan 23, 2019 at 12:47 PM Stephen Hemminger
<stephen@...workplumber.org> wrote:
>
> On Thu, 17 Jan 2019 13:18:55 -0800
> Cong Wang <xiyou.wangcong@...il.com> wrote:
>
> >
> > + if (tb[TCA_MATCHALL_PCNT]) {
> > + if (RTA_PAYLOAD(tb[TCA_MATCHALL_PCNT]) < sizeof(*pf)) {
> > + print_string(PRINT_FP, NULL, "Broken perf counters\n", NULL);
>
> This the wrong way to print an error message with iproute2 suite.
> The correct answer is simple.
> fprintf(stderr, "Broken perf counters\n");
> and better yet give a more informative message that says what is incorrect.
What's your suggestion?
In fact, I am not sure if we really have to check the size here, it should
be safe to assume kernel will always dump a non-broken struct here,
and this struct will never shrink.
Powered by blists - more mailing lists