lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPhsuW7dkct5EC88VaBZ6ibYjSRDFQG1dzd0_m8i5+cKHxjWEg@mail.gmail.com>
Date:   Wed, 27 Jun 2018 10:03:44 -0700
From:   Song Liu <liu.song.a23@...il.com>
To:     Jesper Dangaard Brouer <brouer@...hat.com>
Cc:     Networking <netdev@...r.kernel.org>,
        Daniel Borkmann <borkmann@...earbox.net>,
        Toke Høiland-Jørgensen <toke@...e.dk>,
        Alexei Starovoitov <alexei.starovoitov@...il.com>
Subject: Re: [bpf-next PATCH 1/2] samples/bpf: extend xdp_rxq_info to read
 packet payload

On Wed, Jun 27, 2018 at 4:23 AM, Jesper Dangaard Brouer
<brouer@...hat.com> wrote:
> On Tue, 26 Jun 2018 16:53:15 -0700
> Song Liu <liu.song.a23@...il.com> wrote:
>
>> > +static char* options2str(enum cfg_options_flags flag)
>> > +{
>> > +       if (flag == NO_TOUCH)
>> > +               return "no_touch";
>> > +       if (flag & READ_MEM)
>> > +               return "read";
>> > +       fprintf(stderr, "ERR: Unknown config option flags");
>> > +       exit(EXIT_FAIL);
>> > +}
>> > +
>>
>> enum cfg_options_flags is used as a bitmap in other parts of the sample.
>> So this function is a little weird (with more flags added).
>
> Sure, and do I handle this correctly in the next patch.
>
> I'm uncertain what you want me to change?
> Do you want me to drop the enum, and use #define instead?

I think  it is good  as-is for sample code.

Acked-by: Song Liu <songliubraving@...com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ