[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5bdcb047-4b25-1390-e04a-ada3e7bf1785@gmail.com>
Date: Wed, 29 Sep 2021 21:37:57 -0600
From: David Ahern <dsahern@...il.com>
To: Nikolay Aleksandrov <razor@...ckwall.org>, netdev@...r.kernel.org
Cc: roopa@...dia.com, donaldsharp72@...il.com, idosch@...sch.org,
Nikolay Aleksandrov <nikolay@...dia.com>
Subject: Re: [RFC iproute2-next 05/11] ip: nexthop: always parse attributes
for printing
On 9/29/21 9:28 AM, Nikolay Aleksandrov wrote:
> @@ -481,56 +457,61 @@ int print_nexthop(struct nlmsghdr *n, void *arg)
> if (filter.proto && filter.proto != nhm->nh_protocol)
> return 0;
>
> - parse_rtattr_flags(tb, NHA_MAX, RTM_NHA(nhm), len, NLA_F_NESTED);
> -
> + err = parse_nexthop_rta(fp, nhm, len, &nhe);
> + if (err) {
> + close_json_object();
> + fprintf(stderr, "Error parsing nexthop: %s\n", strerror(err));
> + return -1;
> + }
so you are doing that but in reverse order. Re-order the patches such
that existing code is refactored with the parse functions first.
Powered by blists - more mailing lists