* netlink.c (decode_netlink_or_printaddr_msg): From
decode_netlink_or_printaddr().
(decode_netlink_or_printaddr): Call decode_netlink_or_printaddr_msg().
---
 netlink.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/netlink.c b/netlink.c
index c1a9ad4..7581f2b 100644
--- a/netlink.c
+++ b/netlink.c
@@ -57,8 +57,9 @@ nlmsg_next(struct tcb *tcp, unsigned long nlh, unsigned long 
*len) {
                ((char *)(nlh) + NLMSG_ALIGN(nlmsghdr.nlmsg_len));
 }
 
-void
-decode_netlink(struct tcb *tcp, unsigned long addr, unsigned long size)
+static void
+decode_netlink_msg(struct tcb *tcp, unsigned long addr,
+                           unsigned long size)
 {
        struct nlmsghdr nlmsghdr;
 
@@ -89,6 +90,17 @@ decode_netlink(struct tcb *tcp, unsigned long addr, unsigned 
long size)
        tprints("}");
 }
 
+void
+decode_netlink(struct tcb *tcp, unsigned long addr, unsigned long size) {
+       if (!nlmsg_ok(tcp, addr, size))
+               return;
+
+       for (; nlmsg_ok(tcp, addr, size);
+            addr = nlmsg_next(tcp, addr, &size)) {
+               decode_netlink_msg(tcp, addr, size);
+       }
+}
+
 static bool
 _decode_netlink(struct tcb *tcp, void *elem_buf, size_t elem_size,
                void *opaque_data) {
-- 
2.8.3


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to