Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
for (ifa = ifaddr; ifa; ifa = ifa->ifa_next)
{
- if (strcmp(dev->name, ifa->ifa_name))
+ if (!ifa->ifa_addr || strcmp(dev->name, ifa->ifa_name))
continue;
if (ifa->ifa_addr->sa_family == AF_INET)
{
for (ifa = ifaddr; ifa && !found; ifa = ifa->ifa_next)
{
- if (strcmp(dev->name, ifa->ifa_name))
+ if (!ifa->ifa_addr || strcmp(dev->name, ifa->ifa_name))
continue;
sin = (struct sockaddr_in *)ifa->ifa_addr;