Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
netdev: check for NULL fields in netdev_get_addrs
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@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Lance Richardson <lrichard@redhat.com>
- Loading branch information