Skip to content

Commit 47be5ba

Browse files
heatdintel-lab-lkp
authored andcommitted
mptcp: Align mptcp_inet6_sk with other protocols
Ever since commit f5f80e3 ("ipv6: remove hard coded limitation on ipv6_pinfo") that protocols stopped using the old "obj_size - sizeof(struct ipv6_pinfo)" way of grabbing ipv6_pinfo, that severely restricted struct layout and caused fun, hard to see issues. However, mptcp_inet6_sk wasn't fixed (unlike tcp_inet6_sk). Do so. The non-cloned sockets already do the right thing using ipv6_pinfo_offset + the generic IPv6 code. Signed-off-by: Pedro Falcato <[email protected]>
1 parent 00eff4a commit 47be5ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/mptcp/protocol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3142,9 +3142,9 @@ static int mptcp_disconnect(struct sock *sk, int flags)
31423142
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
31433143
static struct ipv6_pinfo *mptcp_inet6_sk(const struct sock *sk)
31443144
{
3145-
unsigned int offset = sizeof(struct mptcp6_sock) - sizeof(struct ipv6_pinfo);
3145+
struct mptcp6_sock *msk6 = container_of(mptcp_sk(sk), struct mptcp6_sock, msk);
31463146

3147-
return (struct ipv6_pinfo *)(((u8 *)sk) + offset);
3147+
return &msk6->np;
31483148
}
31493149

31503150
static void mptcp_copy_ip6_options(struct sock *newsk, const struct sock *sk)

0 commit comments

Comments
 (0)