Commit e136735f authored by Jakub Kicinski's avatar Jakub Kicinski

tools: pynl: make flags argument optional for do()

Commit 1768d8a7 ("tools/net/ynl: Add support for create flags")
added support for setting legacy netlink CRUD flags on netlink
messages (NLM_F_REPLACE, _EXCL, _CREATE etc.).

Most of genetlink won't need these, don't force callers to pass
in an empty argument to each do() call.
Reviewed-by: default avatarDonald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20231202211005.341613-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent bce49343
...@@ -705,7 +705,7 @@ class YnlFamily(SpecFamily): ...@@ -705,7 +705,7 @@ class YnlFamily(SpecFamily):
return op['do']['request']['attributes'].copy() return op['do']['request']['attributes'].copy()
def _op(self, method, vals, flags, dump=False): def _op(self, method, vals, flags=None, dump=False):
op = self.ops[method] op = self.ops[method]
nl_flags = Netlink.NLM_F_REQUEST | Netlink.NLM_F_ACK nl_flags = Netlink.NLM_F_REQUEST | Netlink.NLM_F_ACK
...@@ -769,7 +769,7 @@ class YnlFamily(SpecFamily): ...@@ -769,7 +769,7 @@ class YnlFamily(SpecFamily):
return rsp[0] return rsp[0]
return rsp return rsp
def do(self, method, vals, flags): def do(self, method, vals, flags=None):
return self._op(method, vals, flags) return self._op(method, vals, flags)
def dump(self, method, vals): def dump(self, method, vals):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment