[libvirt] [PATCH v2 2/2] virarptable: Return a virArpTablePtr when the nlmsghdr for loop is over

John Ferlan jferlan at redhat.com
Fri Sep 14 15:27:33 UTC 2018


$SUBJ:

s/virarptable/util/

On 09/13/2018 03:54 AM, Lin Ma wrote:
> commit b00c9c39 removed the label end_of_netlink_messages and 'return
> table' statement, It causes the function virArpTableGet doesn't return
> a proper virArpTable pointer.
> 
> How to reproduce:
>  # virsh domiflist sles12sp3
> Interface  Type       Source     Model       MAC
> -------------------------------------------------------
> vnet0      network    default    virtio      52:54:00:cd:02:e6
> 
>  # virsh domifaddr sles12sp3 --source arp
> error: Failed to query for interfaces addresses
> error: An error occurred, but the cause is unknown
> 
> It seems that the "if (nh->nlmsg_type == NLMSG_DONE)" statement won't be
> meted. So this patch adds 'return table' when the iterations of nlmsghdr
> for loop is over.
> 
> Signed-off-by: Lin Ma <lma at suse.com>
> Reviewed-by: Chen Hanxiao <chenhanxiao at gmail.com>
> ---
>  src/util/virarptable.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

good catch, thanks -

Reviewed-by: John Ferlan <jferlan at redhat.com>

(and pushed)

John




More information about the libvir-list mailing list