Re: [PATCH v8 3/4] Netlink: handle multi netlink messages

2016-07-05 Thread Dmitry V. Levin
On Tue, Jul 05, 2016 at 12:03:53PM +, Fabien Siron wrote: > Quoting Dmitry V. Levin (2016-07-04 22:14:40) > > On Wed, Jun 29, 2016 at 12:20:00PM +, Fabien Siron wrote: [...] > > > +void > > > +decode_netlink(struct tcb *tcp, unsigned long addr, unsigned long > > > total_size) { > > > +

Re: [PATCH v8 3/4] Netlink: handle multi netlink messages

2016-07-05 Thread Fabien Siron
Quoting Dmitry V. Levin (2016-07-04 22:14:40) > On Wed, Jun 29, 2016 at 12:20:00PM +, Fabien Siron wrote: > > +static unsigned long > > +next_nlmsg(struct nlmsghdr *nlmsghdr, unsigned long addr, unsigned long > > *len) { > > + if (NLMSG_ALIGN(nlmsghdr->nlmsg_len) == 0 || > > + NLMS

Re: [PATCH v8 3/4] Netlink: handle multi netlink messages

2016-07-04 Thread Dmitry V. Levin
On Wed, Jun 29, 2016 at 12:20:00PM +, Fabien Siron wrote: > +static unsigned long > +next_nlmsg(struct nlmsghdr *nlmsghdr, unsigned long addr, unsigned long > *len) { > + if (NLMSG_ALIGN(nlmsghdr->nlmsg_len) == 0 || > + NLMSG_ALIGN(nlmsghdr->nlmsg_len) > *len) { > + *le

[PATCH v8 3/4] Netlink: handle multi netlink messages

2016-06-29 Thread Fabien Siron
Handle the case where there are several messages in the buffer. This is very useful to some protocols like SOCK_DIAG. * netlink.c (fetch_nlmsg, next_nlmsg): New functions. (decode_netlink_msg): New function. (decode_netlink): Call decode_netlink_msg(). * tests/netlink_parsing.c (send_query): Adapt