[ovs-dev] [PATCH v3] netdev: check for NULL fields in netdev_get_addrs

Ben Pfaff blp at ovn.org
Tue Aug 8 23:46:47 UTC 2017


On Fri, Jul 21, 2017 at 03:28:24PM +0000, Daniel Alvarez wrote:
> When the interfaces list is retrieved through getiffaddrs(), there
> might be elements with iface_name set to NULL.
> 
> This patch checks ifa_name to be not NULL before comparing it to the
> actual device name in the loop that calculates how many interfaces
> exist with that same name.
> 
> Also, this patch checks that ifa_netmask is not NULL for coherence
> with the existing code so that it doesn't allocate more memory
> than needed if this field is NULL.
> 
> Note, that these checks are already being done later in the function
> so it should be done in both places.
> 
> Signed-off-by: Daniel Alvarez <dalvarez at redhat.com>
> ---
> v2 -> v3: fix email formatting since v2 wasn't correctly picked by
>           patchwork.

Thanks.  I applied this to master, branch-2.8, branch-2.7, and
branch-2.6.


More information about the dev mailing list