[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230605094617.3564079-1-arkadiusz.kubalewski@intel.com>
Date: Mon, 5 Jun 2023 11:46:17 +0200
From: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
To: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
kuba@...nel.org,
davem@...emloft.net,
pabeni@...hat.com,
edumazet@...gle.com,
chuck.lever@...cle.com
Cc: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
Subject: [PATCH 66/69] ynl: fix nested policy attribute type
When nested attribute is used, generated type in the netlink policy
is NLA_NEST, which is wrong as there is no such type. Fix be adding
`ed` sufix for policy generated for 'nest' type attribute.
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
---
tools/net/ynl/ynl-gen-c.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index 28afb0846143..89603866d4a0 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -113,7 +113,10 @@ class Type(SpecAttr):
return '{ .type = ' + policy + ', }'
def attr_policy(self, cw):
- policy = c_upper('nla-' + self.attr['type'])
+ if (self.attr['type'] == 'nest'):
+ policy = c_upper('nla-' + self.attr['type'] + 'ed')
+ else:
+ policy = c_upper('nla-' + self.attr['type'])
spec = self._attr_policy(policy)
cw.p(f"\t[{self.enum_name}] = {spec},")
--
2.31.1
Powered by blists - more mailing lists