[Dnsmasq-discuss] [PATCH] fix for netlink ENOBUF problem
Simon Kelley
simon at thekelleys.org.uk
Mon Jul 11 18:38:09 BST 2016
Great stuff. Thanks chasing this. Patch applied.
Cheers,
Simon.
On 11/07/16 13:17, Ivan Kokshaysky wrote:
> Hi Simon,
>
> as expected, the second patch works well for us. Please apply.
>
> Ivan.
>
> diff --git a/src/netlink.c b/src/netlink.c
> index 049247b..8cd51af 100644
> --- a/src/netlink.c
> +++ b/src/netlink.c
> @@ -188,11 +188,17 @@ int iface_enumerate(int family, void *parm, int (*callback)())
> }
>
> for (h = (struct nlmsghdr *)iov.iov_base; NLMSG_OK(h, (size_t)len); h = NLMSG_NEXT(h, len))
> - if (h->nlmsg_seq != seq || h->nlmsg_pid != netlink_pid || h->nlmsg_type == NLMSG_ERROR)
> + if (h->nlmsg_pid != netlink_pid || h->nlmsg_type == NLMSG_ERROR)
> {
> /* May be multicast arriving async */
> nl_async(h);
> }
> + else if (h->nlmsg_seq != seq)
> + {
> + /* May be part of incomplete response to previous request after
> + ENOBUFS. Drop it. */
> + continue;
> + }
> else if (h->nlmsg_type == NLMSG_DONE)
> return callback_ok;
> else if (h->nlmsg_type == RTM_NEWADDR && family != AF_UNSPEC && family != AF_LOCAL)
>
More information about the Dnsmasq-discuss
mailing list