Fix a compilation warning without CONFIG_IPV6 but with CONFIG_MPTCP:
net/mptcp/pm_userspace.c: In function 'mptcp_nl_find_ssk':
net/mptcp/pm_userspace.c:309:28: error: unused variable 'pinfo' [-Werror=unused-variable]
309 | const struct ipv6_pinfo *pinfo;
| ^~~~~
Reported by the CI:
https://github.com/multipath-tcp/mptcp_net-next/runs/6039191808?check_suite_focus=true#step%3A6%3A10367=
That's a shame these warnings were ignored :)
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
Notes:
to be squashed in "mptcp: netlink: allow userspace-driven subflow establishment"
net/mptcp/pm_userspace.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 735ff7ff71af..fce61530fe9e 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -306,7 +306,6 @@ static struct sock *mptcp_nl_find_ssk(struct mptcp_sock *msk,
lock_sock(sk);
mptcp_for_each_subflow(msk, subflow) {
- const struct ipv6_pinfo *pinfo;
const struct inet_sock *issk;
struct sock *ssk;
@@ -324,12 +323,14 @@ static struct sock *mptcp_nl_find_ssk(struct mptcp_sock *msk,
continue;
break;
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
- case AF_INET6:
- pinfo = inet6_sk(ssk);
+ case AF_INET6: {
+ const struct ipv6_pinfo *pinfo = inet6_sk(ssk);
+
if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
!ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
continue;
break;
+ }
#endif
default:
continue;
--
2.34.1