On Wed, Jun 22, 2016 at 12:18:38PM +, Fabien Siron wrote:
> Quoting Dmitry V. Levin (2016-06-22 11:13:42)
> > On Wed, Jun 22, 2016 at 10:19:03AM +, Fabien Siron wrote:
> > > Quoting Dmitry V. Levin (2016-06-21 17:43:49)
> > > > On Tue, Jun 21, 2016 at 02:42:46PM +, Fabien Siron wrote:
>
Quoting Dmitry V. Levin (2016-06-22 11:13:42)
> On Wed, Jun 22, 2016 at 10:19:03AM +, Fabien Siron wrote:
> > Quoting Dmitry V. Levin (2016-06-21 17:43:49)
> > > On Tue, Jun 21, 2016 at 02:42:46PM +, Fabien Siron wrote:
[...]
> > > > + if (nlmsghdr.nlmsg_len != (unsigned) -1 &&
> > > >
On Wed, Jun 22, 2016 at 10:19:03AM +, Fabien Siron wrote:
> Quoting Dmitry V. Levin (2016-06-21 17:43:49)
> > On Tue, Jun 21, 2016 at 02:42:46PM +, Fabien Siron wrote:
> > [...]
> > > +static unsigned long
> > > +nlmsg_next(struct nlmsghdr *nlmsghdr, unsigned long addr, unsigned long
> > >
Quoting Dmitry V. Levin (2016-06-21 17:43:49)
> On Tue, Jun 21, 2016 at 02:42:46PM +, Fabien Siron wrote:
> [...]
> > +static unsigned long
> > +nlmsg_next(struct nlmsghdr *nlmsghdr, unsigned long addr, unsigned long
> > *len) {
> > + *len -= NLMSG_ALIGN(nlmsghdr->nlmsg_len);
> > +
> > +
On Tue, Jun 21, 2016 at 02:42:46PM +, Fabien Siron wrote:
[...]
> +static unsigned long
> +nlmsg_next(struct nlmsghdr *nlmsghdr, unsigned long addr, unsigned long
> *len) {
> + *len -= NLMSG_ALIGN(nlmsghdr->nlmsg_len);
> +
> + if (NLMSG_ALIGN(nlmsghdr->nlmsg_len) == 0 ||
> + NL
This commit handles the case where there are several messages in the buffer.
This is very useful to some protocols like SOCK_DIAG.
* netlink.c (nlmsg_fetch, nlmsg_next): New functions.
(decode_netlink_msg): New function.
(decode_netlink): Call decode_netlink_msg().
* tests/netlink_parsing.c (send_