]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mptcp: pm: use ipv6_addr_equal in addresses_equal
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 21 Feb 2025 15:44:00 +0000 (16:44 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Feb 2025 02:23:44 +0000 (18:23 -0800)
Use ipv6_addr_equal() to check whether two IPv6 addresses are equal in
mptcp_addresses_equal().

This is more appropriate than using !ipv6_addr_cmp().

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250221-net-next-mptcp-pm-misc-cleanup-3-v1-7-2b70ab1cee79@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm_netlink.c

index f67b637c1fcf7c2930ced8b5c6b9df156118cbcd..ef85a60151ad796b445afc21bcbcae1c52ef64b6 100644 (file)
@@ -64,7 +64,7 @@ bool mptcp_addresses_equal(const struct mptcp_addr_info *a,
                        addr_equals = a->addr.s_addr == b->addr.s_addr;
 #if IS_ENABLED(CONFIG_MPTCP_IPV6)
                else
-                       addr_equals = !ipv6_addr_cmp(&a->addr6, &b->addr6);
+                       addr_equals = ipv6_addr_equal(&a->addr6, &b->addr6);
        } else if (a->family == AF_INET) {
                if (ipv6_addr_v4mapped(&b->addr6))
                        addr_equals = a->addr.s_addr == b->addr6.s6_addr32[3];