On Wed, Jun 15, 2016 at 12:43:05PM +0000, Fabien Siron wrote:
> * 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);

Why two nlmsg_ok calls in a row?

> +          addr = nlmsg_next(tcp, addr, &size)) {
> +             decode_netlink_msg(tcp, addr, size);
> +     }

Shouldn't output from subsequent decode_netlink_msg calls be delimited?


-- 
ldv

Attachment: pgprVIPIDYU_H.pgp
Description: PGP signature

------------------------------------------------------------------------------
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://sdm.link/zohomanageengine
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to