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: <20170612141655.GE1993@nanopsycho>
Date:   Mon, 12 Jun 2017 16:16:55 +0200
From:   Jiri Pirko <jiri@...nulli.us>
To:     Jamal Hadi Salim <jhs@...atatu.com>
Cc:     davem@...emloft.net, netdev@...r.kernel.org,
        xiyou.wangcong@...il.com, eric.dumazet@...il.com,
        simon.horman@...ronome.com, mrv@...atatu.com
Subject: Re: [PATCH net-next v10 3/4] net sched actions: dump more than
 TCA_ACT_MAX_PRIO actions per batch

Mon, Jun 12, 2017 at 03:57:05PM CEST, jhs@...atatu.com wrote:
>On 17-06-12 07:47 AM, Jiri Pirko wrote:
>> Mon, Jun 12, 2017 at 01:16:05PM CEST, jhs@...atatu.com wrote:
>> > On 17-06-11 10:13 AM, Jiri Pirko wrote:
>
>> > This also is not useful.
>> > It happens to be ok for this use case but not for the
>> > general case. i.e.
>> > We need to get the whole struct not just the values
>> > and use the selector to pick what bits are affected.
>> > Example if bit X is set to 1 in selector and bit X in value
>> > is 0, then we set the kernel's bit X to 0.
>> 
>> Sure, have another helper for selector then.
>> Or, you can have:
>> 
>> 	struct nla_flag_bits *fb;
>> 	fb = nla_get_flag_bits(tb[TCA_ROOT_FLAGS]);
>> 
>> Or all 3 helpers. My point is, it is a specific netlink attribute with
>> specific format, it should have get/put helpers.
>> 
>
>I did try nla_get_flag_bits(tb[TCA_ROOT_FLAGS], &fb) so i dont have
>to do alloc/free - it ended being a single line function which
>does a memcpy.
>Is this really necessary?

Yes please, it is necessary! By the same logic, nla_get_u32 would not be
necessary.

I don't understand why you need alloc/free...


>The user of this structure better know it to make use of it.
>
>cheers,
>jamal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ