Re: [PATCHv4 iproute2] ip route: ignore ENOENT during save if RT_TABLE_MAIN is being dumped
From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2021-07-06 15:34:13
From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2021-07-06 15:34:13
On Tue, 29 Jun 2021 18:51:15 +0300 Alexander Mikhalitsyn [off-list ref] wrote:
+ const struct rtnl_dump_filter_arg a[2] = {
+ { .filter = filter, .arg1 = arg1,
+ .errhndlr = errhndlr, .arg2 = arg2, .nc_flags = nc_flags, },
+ { .filter = NULL, .arg1 = NULL,
+ .errhndlr = NULL, .arg2 = NULL, .nc_flags = 0, },
};
I am OK with this as is. But you don't need to add initializers for fields
that are 0/NULL (at least in C).
So could be:
const struct rtnl_dump_filter_arg a[] = {
{ .filter = filter, .arg1 = arg1,
.errhndlr = errhndlr, .arg2 = arg2, .nc_flags = nc_flags, },
{ },
};