Re: [PATCH net-next 2/3] nexthop: Use a dedicated policy for nh_valid_dump_req()

2021-01-20 Thread Petr Machata
Jakub Kicinski writes: > On Mon, 18 Jan 2021 15:05:24 +0100 Petr Machata wrote: >> +if (tb[NHA_GROUPS]) >> +*group_filter = true; >> +if (tb[NHA_FDB]) >> +*fdb_filter = true; > > nla_get_flag() OK.

Re: [PATCH net-next 2/3] nexthop: Use a dedicated policy for nh_valid_dump_req()

2021-01-19 Thread Jakub Kicinski
On Mon, 18 Jan 2021 15:05:24 +0100 Petr Machata wrote: > + if (tb[NHA_GROUPS]) > + *group_filter = true; > + if (tb[NHA_FDB]) > + *fdb_filter = true; nla_get_flag()

Re: [PATCH net-next 2/3] nexthop: Use a dedicated policy for nh_valid_dump_req()

2021-01-18 Thread David Ahern
On 1/18/21 7:05 AM, Petr Machata wrote: > This function uses the global nexthop policy, but only accepts four > particular attributes. Create a new policy that only includes the four > supported attributes, and use it. Convert the loop to a series of ifs. > > Signed-off-by: Petr Machata > Reviewe

[PATCH net-next 2/3] nexthop: Use a dedicated policy for nh_valid_dump_req()

2021-01-18 Thread Petr Machata
This function uses the global nexthop policy, but only accepts four particular attributes. Create a new policy that only includes the four supported attributes, and use it. Convert the loop to a series of ifs. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- net/ipv4/nexthop.c | 57 +++