[libvirt] [PATCH v3 1/4] util: introduce helper to parse /proc/net/arp

Chen Hanxiao chen_han_xiao at 126.com
Tue Feb 6 11:09:22 UTC 2018



At 2018-01-29 20:01:30, "Peter Krempa" <pkrempa at redhat.com> wrote:
>On Mon, Jan 29, 2018 at 16:35:33 +0800, Chen Hanxiao wrote:
>> From: Chen Hanxiao <chenhanxiao at gmail.com>
>> 
>> introduce helper to parse /proc/net/arp and
>> store it in struct virArpTable.
>> 
>> Signed-off-by: Chen Hanxiao <chenhanxiao at gmail.com>
>> ---
>> v3:
[...]
>
>
>without limiting the size here is a great idea. That is a buffer
>overflow right here.
>
>Also parsing /proc/net/arp is not enough, it will not list IPv6
>neighbors.
>
>Additionally I'd stay away from parsing this file completely. Not even
>the obsolete 'arp' utility is using this but rather uses AF_NETLINK
>socket to discover it.
>
>NACK on this approach.

I'll use RTM_GETNEIGH to get these.
Thanks for the advice.

Regards,
- Chen




More information about the libvir-list mailing list