From 4b9f4c251344bf350454d0b9e9184ae663c39fc3 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 15 Aug 2023 13:51:27 +1000 Subject: netlink: Remove redundant check on nlmsg_type 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 Signed-off-by: Stefano Brivio --- netlink.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'netlink.c') 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 || -- cgit v1.2.3