[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190328022949.rolbfyk5bkcib3jr@ast-mbp>
Date: Wed, 27 Mar 2019 19:29:51 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: David Ahern <dsahern@...il.com>
Cc: David Ahern <dsahern@...nel.org>, davem@...emloft.net,
netdev@...r.kernel.org, idosch@...lanox.com, jiri@...lanox.com,
saeedm@...lanox.com
Subject: Re: [PATCH v2 net-next 05/13] ipv6: Create init helper for fib6_nh
On Wed, Mar 27, 2019 at 08:05:03PM -0600, David Ahern wrote:
> On 3/27/19 7:30 PM, Alexei Starovoitov wrote:
> >>>
> >>> imo it would be cleaner not to mess with cfg.
> >>> Ideally it should be marked 'const'.
> >>
> >> Existing code sets those flags but on a fib6_info. This is not used for
> >> nexthop objects and is kept here to not duplicate this if branch in the
> >> create_info that uses it. This check affects both which device is used
> >> as well as the flags.
> >
> > What stopping you from doing fib6_nh->nh_flags |= RTF_REJECT | RTF_NONEXTHOP ?
> > cfg should really be const.
>
> Because it is not a nexthop flag, it is a prefix flag.
that was a typo. I meant fib6_flags.
why mess with cfg and use it as weird side effect only to
get rt->fib6_flags = cfg->fc_flags; working after fib6_nh_init() returns?
Why not to move that fib6_flags = fc_flags assignment into fib6_nh_init ?
Then cfg can stay constant and no weird side effects from init function.
Powered by blists - more mailing lists