Thread (1 message) 1 message, 1 author, 2023-08-23

Re: [PATCH net-next v3 07/12] tools/net/ynl: Add support for netlink-raw families

From: Donald Hunter <donald.hunter@gmail.com>
Date: 2023-08-23 07:39:14
Also in: linux-doc

Possibly related (same subject, not in this thread)

Donald Hunter [off-list ref] writes:
-    def handle_ntf(self, nl_msg, genl_msg):
+    def handle_ntf(self, decoded):
         msg = dict()
         if self.include_raw:
-            msg['nlmsg'] = nl_msg
-            msg['genlmsg'] = genl_msg
-        op = self.rsp_by_value[genl_msg.genl_cmd]
+            msg['raw'] = decoded
+        op = self.rsp_by_value[decoded.cmd()]
+        attrs = self._decode(decoded.raw_attrs, op.attr_set.name)
+        if op.fixed_header:
+            attrs.update(self._decode_fixed_header(gm, op.fixed_header))
There's a mistake here, 'gm' should be 'decoded'. I'll fix in a v4.
+
         msg['name'] = op['name']
-        msg['msg'] = self._decode(genl_msg.raw_attrs, op.attr_set.name)
+        msg['msg'] = attrs
         self.async_msg_queue.append(msg)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help