[libvirt] [PATCH 2/2] netlink: add support for multi-part netlink messages.
Dmitry Guryanov
dguryanov at virtuozzo.com
Tue Aug 4 15:24:26 UTC 2015
On 07/31/2015 07:35 PM, Maxim Perevedentsev wrote:
> Such messages do not have NLMSG_ERROR or NLMSG_DONE type
> but they are valid responses. We test 'multi-partness'
> by looking for NLM_F_MULTI flag.
This patch looks OK to me except for comment style.
> ---
> src/util/virnetlink.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
> index 0052ef9..105a604 100644
> --- a/src/util/virnetlink.c
> +++ b/src/util/virnetlink.c
> @@ -386,7 +386,9 @@ virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen)
> break;
>
> default:
> - goto malformed_resp;
> + // We allow multipart messages.
> + if (!(resp->nlmsg_flags & NLM_F_MULTI))
> + goto malformed_resp;
> }
>
> return result;
> --
> Sincerely,
> Maxim Perevedentsev
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
More information about the libvir-list
mailing list