[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f27315c4-c20c-48cc-9fee-7f00c853921e@kernel.org>
Date: Mon, 13 Nov 2023 15:38:18 -0700
From: David Ahern <dsahern@...nel.org>
To: Stephen Hemminger <stephen@...workplumber.org>,
Daniel Borkmann <daniel@...earbox.net>
Cc: razor@...ckwall.org, martin.lau@...nel.org, netdev@...r.kernel.org
Subject: Re: [PATCH iproute2] ip, link: Add support for netkit
On 11/13/23 10:34 AM, Stephen Hemminger wrote:
> On Mon, 13 Nov 2023 04:23:23 +0100
> Daniel Borkmann <daniel@...earbox.net> wrote:
>
>> + if (tb[IFLA_NETKIT_POLICY]) {
>> + __u32 policy = rta_getattr_u32(tb[IFLA_NETKIT_POLICY]);
>> + const char *policy_str =
>> + policy == NETKIT_PASS ? "forward" :
>> + policy == NETKIT_DROP ? "blackhole" : "unknown";
>> +
>
> If you plan to add more modes in future, a table or helper would be good idea.
>
I would prefer a table driven approach through a helper than the
multi-line logic here.
Powered by blists - more mailing lists