Message ID | 20200121225933.3038131-1-matthieu.baerts@tessares.net |
---|---|
State | Superseded, archived |
Delegated to: | Mat Martineau |
Headers | show |
Series | mptcp: fix compilation warning without IPV6 | expand |
On Tue, 21 Jan 2020, Matthieu Baerts wrote: > Spot by Mat: > > net/mptcp/protocol.c: In function ‘mptcp_copy_inaddrs’: > net/mptcp/protocol.c:672:21: warning: unused variable ‘msk6’ [-Wunused-variable] > 672 | struct ipv6_pinfo *msk6 = inet6_sk(msk); > | ^~~~ > net/mptcp/protocol.c:671:27: warning: unused variable ‘ssk6’ [-Wunused-variable] > 671 | const struct ipv6_pinfo *ssk6 = inet6_sk(ssk); > | ^~~~ > > Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> > --- > > Notes: > to be squashed in "mptcp: Create SUBFLOW socket for incoming connections" > > net/mptcp/protocol.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c > index 84799a5212a2..41e83270c984 100644 > --- a/net/mptcp/protocol.c > +++ b/net/mptcp/protocol.c > @@ -217,8 +217,10 @@ static void mptcp_close(struct sock *sk, long timeout) > > static void mptcp_copy_inaddrs(struct sock *msk, const struct sock *ssk) > { > +#if IS_ENABLED(CONFIG_MPTCP_IPV6) > const struct ipv6_pinfo *ssk6 = inet6_sk(ssk); > struct ipv6_pinfo *msk6 = inet6_sk(msk); > +#endif Yes, I think it's good to use this simple fix because we don't want to rearrange things and create conflicts right now. > > inet_sk(msk)->inet_num = inet_sk(ssk)->inet_num; > inet_sk(msk)->inet_dport = inet_sk(ssk)->inet_dport; > -- > 2.24.0 -- Mat Martineau Intel
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 84799a5212a2..41e83270c984 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -217,8 +217,10 @@ static void mptcp_close(struct sock *sk, long timeout) static void mptcp_copy_inaddrs(struct sock *msk, const struct sock *ssk) { +#if IS_ENABLED(CONFIG_MPTCP_IPV6) const struct ipv6_pinfo *ssk6 = inet6_sk(ssk); struct ipv6_pinfo *msk6 = inet6_sk(msk); +#endif inet_sk(msk)->inet_num = inet_sk(ssk)->inet_num; inet_sk(msk)->inet_dport = inet_sk(ssk)->inet_dport;
Spot by Mat: net/mptcp/protocol.c: In function ‘mptcp_copy_inaddrs’: net/mptcp/protocol.c:672:21: warning: unused variable ‘msk6’ [-Wunused-variable] 672 | struct ipv6_pinfo *msk6 = inet6_sk(msk); | ^~~~ net/mptcp/protocol.c:671:27: warning: unused variable ‘ssk6’ [-Wunused-variable] 671 | const struct ipv6_pinfo *ssk6 = inet6_sk(ssk); | ^~~~ Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> --- Notes: to be squashed in "mptcp: Create SUBFLOW socket for incoming connections" net/mptcp/protocol.c | 2 ++ 1 file changed, 2 insertions(+)