In the loop within nl_addr_dup() we check and skip for any messages that aren't of type RTM_NEWADDR. This is a leftover that was missed in the recent big netlink cleanup. In fact we already check for the message type in the nl_foreach_oftype() macro, so the explicit test is redudant. Remove it. Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- netlink.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/netlink.c b/netlink.c index 1226379..ff44e13 100644 --- a/netlink.c +++ b/netlink.c @@ -669,9 +669,6 @@ int nl_addr_dup(int s_src, unsigned int ifi_src, struct rtattr *rta; size_t na; - if (nh->nlmsg_type != RTM_NEWADDR) - continue; - ifa = (struct ifaddrmsg *)NLMSG_DATA(nh); if (rc < 0 || ifa->ifa_scope == RT_SCOPE_LINK || -- 2.41.0