1
0
mirror of https://passt.top/passt synced 2024-06-30 15:02:40 +00:00

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 <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2023-08-15 13:51:27 +10:00 committed by Stefano Brivio
parent 5ed4e034b2
commit 4b9f4c2513

View File

@ -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 ||