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]
Date:   Mon, 29 Apr 2019 13:36:03 -0700
From:   Tom Herbert <tom@...ntonium.net>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     Tom Herbert <tom@...bertland.com>,
        "David S . Miller" <davem@...emloft.net>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH v7 net-next 4/6] exthdrs: Add TX parameters

On Mon, Apr 29, 2019 at 12:35 PM Stephen Hemminger
<stephen@...workplumber.org> wrote:
>
> On Mon, 29 Apr 2019 11:46:14 -0700
> Tom Herbert <tom@...bertland.com> wrote:
>
> >  /* Default (unset) values for TLV parameters */
> >  static const struct tlv_proc tlv_default_proc = {
> > -     .params.rx_class = 0,
> > +     .params.r.class = 0,
> > +
> > +     .params.t.preferred_order = 0,
> > +     .params.t.admin_perm = IPV6_TLV_PERM_NO_CHECK,
> > +     .params.t.user_perm = IPV6_TLV_PERM_NONE,
> > +     .params.t.class = 0,
> > +     .params.t.align_mult = (4 - 1), /* Default alignment: 4n + 2 */
> > +     .params.t.align_off = 2,
> > +     .params.t.min_data_len = 0,
> > +     .params.t.max_data_len = 255,
> > +     .params.t.data_len_mult = (1 - 1), /* No default length align */
> > +     .params.t.data_len_off = 0,
> >  };
>
> This looks cleaner if you skip the unnecessary 0 entries
> and also use additional {}.

Hi Stephen,

I sort of like being explict here to list all the fields to make it
easy to use as a template for adding new structures.

Tom

>
> static const struct tlv_proc tlv_default_proc = {
>         .params.t = {
>                 .admin_perm = IPV6_TLV_PERM_NO_CHECK,
>                 .user_perm = IPV6_TLV_PERM_NONE,
>                 .align_mult = 3,  /* Default alignment: 4n + 2 */
>                 .align_off = 2,
>                 .max_data_len = 255,
>         },
> };
>
>

Powered by blists - more mailing lists