for (struct nlmsghdr *nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, len); nh = NLMSG_NEXT(nh, len))
{
- if (nh != NULL && nh->nlmsg_type != RTM_NEWLINK)
+ if (nh != NULL && (nh->nlmsg_type != RTM_DELADDR && nh->nlmsg_type != RTM_NEWADDR))
{
continue;
}
struct ifinfomsg *ifi = (struct ifinfomsg *)NLMSG_DATA(nh);
-
- if ((!ifi || (ifi->ifi_flags & IFF_LOOPBACK) || !(ifi->ifi_flags & IFF_RUNNING)))
+ if (!ifi)
{
continue;
}
int ifiIndex = ifi->ifi_index;
iflist = CAIPGetInterfaceInformation(ifiIndex);
-
if (!iflist)
{
OIC_LOG_V(ERROR, TAG, "get interface info failed: %s", strerror(errno));