From 5e21861d417cc575af688e618aba821e5d4499dc Mon Sep 17 00:00:00 2001 From: suyuan168 <175338101@qq.com> Date: Tue, 4 Jan 2022 16:45:42 +0800 Subject: [PATCH] fix --- root/include/kernel-version.mk | 4 +- .../generic/hack-5.4/690-mptcp_v0.96.patch | 1685 ++++++++--------- 2 files changed, 792 insertions(+), 897 deletions(-) mode change 100755 => 100644 root/include/kernel-version.mk mode change 100755 => 100644 root/target/linux/generic/hack-5.4/690-mptcp_v0.96.patch diff --git a/root/include/kernel-version.mk b/root/include/kernel-version.mk old mode 100755 new mode 100644 index 1073acf6..b7efe8fc --- a/root/include/kernel-version.mk +++ b/root/include/kernel-version.mk @@ -6,12 +6,12 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .169 +LINUX_VERSION-5.4 = .132 LINUX_VERSION-5.10 = .64 LINUX_VERSION-5.14 = .6 LINUX_VERSION-5.15 = .4 -LINUX_KERNEL_HASH-5.4.169 = 554382d95f71afd5f9b49292eb5d1cbe3be1a0bad22d21487c9e6d506ee01a19 +LINUX_KERNEL_HASH-5.4.132 = 8466adbfb3579e751ede683496df7bb20f258b5f882250f3dd82be63736d00ef LINUX_KERNEL_HASH-5.10.64 = 3eb84bd24a2de2b4749314e34597c02401c5d6831b055ed5224adb405c35e30a LINUX_KERNEL_HASH-5.14.6 = 54848c1268771ee3515e4c33e29abc3f1fa90d8144894cce6d0ebc3b158bccec LINUX_KERNEL_HASH-5.15.4 = 549d0fb75e65f6158e6f4becc648f249d386843da0e1211460bde8b1ea99cbca diff --git a/root/target/linux/generic/hack-5.4/690-mptcp_v0.96.patch b/root/target/linux/generic/hack-5.4/690-mptcp_v0.96.patch old mode 100755 new mode 100644 index e2c39495..297808af --- a/root/target/linux/generic/hack-5.4/690-mptcp_v0.96.patch +++ b/root/target/linux/generic/hack-5.4/690-mptcp_v0.96.patch @@ -1,7 +1,6 @@ -diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt -index dbb68067ba4e..b6c32a29789e 100644 ---- a/Documentation/admin-guide/kernel-parameters.txt -+++ b/Documentation/admin-guide/kernel-parameters.txt +diff -aurN linux-5.4.155/Documentation/admin-guide/kernel-parameters.txt mptcp-mptcp_v0.96/Documentation/admin-guide/kernel-parameters.txt +--- linux-5.4.155/Documentation/admin-guide/kernel-parameters.txt 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/Documentation/admin-guide/kernel-parameters.txt 2021-10-25 10:05:18.000000000 +0200 @@ -2742,6 +2742,10 @@ allocations which rules out almost all kernel allocations. Use with caution! @@ -13,11 +12,10 @@ index dbb68067ba4e..b6c32a29789e 100644 MTD_Partition= [MTD] Format: ,,, -diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt -index 8af3771a3ebf..e8fecb8f6370 100644 ---- a/Documentation/networking/ip-sysctl.txt -+++ b/Documentation/networking/ip-sysctl.txt -@@ -818,6 +818,18 @@ tcp_rx_skb_cache - BOOLEAN +diff -aurN linux-5.4.155/Documentation/networking/ip-sysctl.txt mptcp-mptcp_v0.96/Documentation/networking/ip-sysctl.txt +--- linux-5.4.155/Documentation/networking/ip-sysctl.txt 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/Documentation/networking/ip-sysctl.txt 2021-10-25 10:05:18.000000000 +0200 +@@ -818,6 +818,18 @@ Default: 0 (disabled) @@ -36,11 +34,10 @@ index 8af3771a3ebf..e8fecb8f6370 100644 UDP variables: udp_l3mdev_accept - BOOLEAN -diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c -index 535ee41ee421..9f82f93e6e77 100644 ---- a/drivers/infiniband/hw/cxgb4/cm.c -+++ b/drivers/infiniband/hw/cxgb4/cm.c -@@ -3950,7 +3950,7 @@ static void build_cpl_pass_accept_req(struct sk_buff *skb, int stid , u8 tos) +diff -aurN linux-5.4.155/drivers/infiniband/hw/cxgb4/cm.c mptcp-mptcp_v0.96/drivers/infiniband/hw/cxgb4/cm.c +--- linux-5.4.155/drivers/infiniband/hw/cxgb4/cm.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/drivers/infiniband/hw/cxgb4/cm.c 2021-10-25 10:05:18.000000000 +0200 +@@ -3950,7 +3950,7 @@ */ memset(&tmp_opt, 0, sizeof(tmp_opt)); tcp_clear_options(&tmp_opt); @@ -49,11 +46,10 @@ index 535ee41ee421..9f82f93e6e77 100644 req = __skb_push(skb, sizeof(*req)); memset(req, 0, sizeof(*req)); -diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index b04b5bd43f54..57e35d51db8c 100644 ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -717,7 +717,7 @@ struct sk_buff { +diff -aurN linux-5.4.155/include/linux/skbuff.h mptcp-mptcp_v0.96/include/linux/skbuff.h +--- linux-5.4.155/include/linux/skbuff.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/linux/skbuff.h 2021-10-25 10:05:18.000000000 +0200 +@@ -717,7 +717,7 @@ * want to keep them across layers you have to do a skb_clone() * first. This is owned by whoever has the skb queued ATM. */ @@ -62,11 +58,10 @@ index b04b5bd43f54..57e35d51db8c 100644 union { struct { -diff --git a/include/linux/tcp.h b/include/linux/tcp.h -index 358deb4ff830..aebfedba9838 100644 ---- a/include/linux/tcp.h -+++ b/include/linux/tcp.h -@@ -54,7 +54,7 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb) +diff -aurN linux-5.4.155/include/linux/tcp.h mptcp-mptcp_v0.96/include/linux/tcp.h +--- linux-5.4.155/include/linux/tcp.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/linux/tcp.h 2021-10-25 10:05:18.000000000 +0200 +@@ -54,7 +54,7 @@ /* TCP Fast Open */ #define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */ #define TCP_FASTOPEN_COOKIE_MAX 16 /* Max Fast Open Cookie size in bytes */ @@ -75,7 +70,7 @@ index 358deb4ff830..aebfedba9838 100644 /* TCP Fast Open Cookie as stored in memory */ struct tcp_fastopen_cookie { -@@ -74,6 +74,56 @@ struct tcp_sack_block { +@@ -74,6 +74,56 @@ u32 end_seq; }; @@ -132,7 +127,7 @@ index 358deb4ff830..aebfedba9838 100644 /*These are used to set the sack_ok field in struct tcp_options_received */ #define TCP_SACK_SEEN (1 << 0) /*1 = peer is SACK capable, */ #define TCP_DSACK_SEEN (1 << 2) /*1 = DSACK was received from peer*/ -@@ -97,6 +147,9 @@ struct tcp_options_received { +@@ -97,6 +147,9 @@ u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ }; @@ -142,7 +137,7 @@ index 358deb4ff830..aebfedba9838 100644 static inline void tcp_clear_options(struct tcp_options_received *rx_opt) { rx_opt->tstamp_ok = rx_opt->sack_ok = 0; -@@ -135,6 +188,8 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) +@@ -135,6 +188,8 @@ return (struct tcp_request_sock *)req; } @@ -151,7 +146,7 @@ index 358deb4ff830..aebfedba9838 100644 struct tcp_sock { /* inet_connection_sock has to be the first member of tcp_sock */ struct inet_connection_sock inet_conn; -@@ -295,6 +350,7 @@ struct tcp_sock { +@@ -295,6 +350,7 @@ u32 rate_interval_us; /* saved rate sample: time elapsed */ u32 rcv_wnd; /* Current receiver window */ @@ -159,7 +154,7 @@ index 358deb4ff830..aebfedba9838 100644 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ u32 notsent_lowat; /* TCP_NOTSENT_LOWAT */ u32 pushed_seq; /* Last pushed seq, required to talk to windows */ -@@ -397,6 +453,44 @@ struct tcp_sock { +@@ -397,6 +453,44 @@ */ struct request_sock __rcu *fastopen_rsk; u32 *saved_syn; @@ -204,7 +199,7 @@ index 358deb4ff830..aebfedba9838 100644 }; enum tsq_enum { -@@ -408,6 +502,8 @@ enum tsq_enum { +@@ -408,6 +502,8 @@ TCP_MTU_REDUCED_DEFERRED, /* tcp_v{4|6}_err() could not call * tcp_v{4|6}_mtu_reduced() */ @@ -213,7 +208,7 @@ index 358deb4ff830..aebfedba9838 100644 }; enum tsq_flags { -@@ -417,6 +513,8 @@ enum tsq_flags { +@@ -417,6 +513,8 @@ TCPF_WRITE_TIMER_DEFERRED = (1UL << TCP_WRITE_TIMER_DEFERRED), TCPF_DELACK_TIMER_DEFERRED = (1UL << TCP_DELACK_TIMER_DEFERRED), TCPF_MTU_REDUCED_DEFERRED = (1UL << TCP_MTU_REDUCED_DEFERRED), @@ -222,7 +217,7 @@ index 358deb4ff830..aebfedba9838 100644 }; static inline struct tcp_sock *tcp_sk(const struct sock *sk) -@@ -440,6 +538,7 @@ struct tcp_timewait_sock { +@@ -440,6 +538,7 @@ #ifdef CONFIG_TCP_MD5SIG struct tcp_md5sig_key *tw_md5_key; #endif @@ -230,10 +225,9 @@ index 358deb4ff830..aebfedba9838 100644 }; static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) -diff --git a/include/net/inet_common.h b/include/net/inet_common.h -index ae2ba897675c..aa91a56bd7af 100644 ---- a/include/net/inet_common.h -+++ b/include/net/inet_common.h +diff -aurN linux-5.4.155/include/net/inet_common.h mptcp-mptcp_v0.96/include/net/inet_common.h +--- linux-5.4.155/include/net/inet_common.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/net/inet_common.h 2021-10-25 10:05:18.000000000 +0200 @@ -2,6 +2,7 @@ #ifndef _INET_COMMON_H #define _INET_COMMON_H @@ -242,7 +236,7 @@ index ae2ba897675c..aa91a56bd7af 100644 #include extern const struct proto_ops inet_stream_ops; -@@ -16,6 +17,8 @@ struct sock; +@@ -16,6 +17,8 @@ struct sockaddr; struct socket; @@ -251,10 +245,9 @@ index ae2ba897675c..aa91a56bd7af 100644 int inet_release(struct socket *sock); int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags); -diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h -index 13792c0ef46e..e99cc510610f 100644 ---- a/include/net/inet_connection_sock.h -+++ b/include/net/inet_connection_sock.h +diff -aurN linux-5.4.155/include/net/inet_connection_sock.h mptcp-mptcp_v0.96/include/net/inet_connection_sock.h +--- linux-5.4.155/include/net/inet_connection_sock.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/net/inet_connection_sock.h 2021-10-25 10:05:18.000000000 +0200 @@ -25,6 +25,7 @@ struct inet_bind_bucket; @@ -263,11 +256,10 @@ index 13792c0ef46e..e99cc510610f 100644 /* * Pointers to address related TCP functions -diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h -index 34c4436fd18f..828f79528b32 100644 ---- a/include/net/inet_sock.h -+++ b/include/net/inet_sock.h -@@ -79,7 +79,7 @@ struct inet_request_sock { +diff -aurN linux-5.4.155/include/net/inet_sock.h mptcp-mptcp_v0.96/include/net/inet_sock.h +--- linux-5.4.155/include/net/inet_sock.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/net/inet_sock.h 2021-10-25 10:05:18.000000000 +0200 +@@ -79,7 +79,7 @@ #define ireq_state req.__req_common.skc_state #define ireq_family req.__req_common.skc_family @@ -276,7 +268,7 @@ index 34c4436fd18f..828f79528b32 100644 rcv_wscale : 4, tstamp_ok : 1, sack_ok : 1, -@@ -87,6 +87,8 @@ struct inet_request_sock { +@@ -87,6 +87,8 @@ ecn_ok : 1, acked : 1, no_srccheck: 1, @@ -285,12 +277,10 @@ index 34c4436fd18f..828f79528b32 100644 smc_ok : 1; u32 ir_mark; union { -diff --git a/include/net/mptcp.h b/include/net/mptcp.h -new file mode 100644 -index 000000000000..196b8939cbab ---- /dev/null -+++ b/include/net/mptcp.h -@@ -0,0 +1,1577 @@ +diff -aurN linux-5.4.155/include/net/mptcp.h mptcp-mptcp_v0.96/include/net/mptcp.h +--- linux-5.4.155/include/net/mptcp.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/include/net/mptcp.h 2021-10-25 10:05:18.000000000 +0200 +@@ -0,0 +1,1573 @@ +/* + * MPTCP implementation + * @@ -1700,10 +1690,6 @@ index 000000000000..196b8939cbab + do { \ + } while(0) + -+#define MPTCP_DEC_STATS(net, field) \ -+ do { \ -+ } while(0) -+ +static inline bool mptcp_is_data_fin(const struct sk_buff *skb) +{ + return false; @@ -1868,11 +1854,9 @@ index 000000000000..196b8939cbab +#endif /* CONFIG_MPTCP */ + +#endif /* _MPTCP_H */ -diff --git a/include/net/mptcp_v4.h b/include/net/mptcp_v4.h -new file mode 100644 -index 000000000000..c58d42b11f6a ---- /dev/null -+++ b/include/net/mptcp_v4.h +diff -aurN linux-5.4.155/include/net/mptcp_v4.h mptcp-mptcp_v0.96/include/net/mptcp_v4.h +--- linux-5.4.155/include/net/mptcp_v4.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/include/net/mptcp_v4.h 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,76 @@ +/* + * MPTCP implementation @@ -1950,11 +1934,9 @@ index 000000000000..c58d42b11f6a +#endif /* CONFIG_MPTCP */ + +#endif /* MPTCP_V4_H_ */ -diff --git a/include/net/mptcp_v6.h b/include/net/mptcp_v6.h -new file mode 100644 -index 000000000000..93e8c87c2eb1 ---- /dev/null -+++ b/include/net/mptcp_v6.h +diff -aurN linux-5.4.155/include/net/mptcp_v6.h mptcp-mptcp_v0.96/include/net/mptcp_v6.h +--- linux-5.4.155/include/net/mptcp_v6.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/include/net/mptcp_v6.h 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,77 @@ +/* + * MPTCP implementation @@ -2033,10 +2015,9 @@ index 000000000000..93e8c87c2eb1 +#endif /* CONFIG_MPTCP */ + +#endif /* _MPTCP_V6_H */ -diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h -index 167e390ac9d4..7233acfcdb4d 100644 ---- a/include/net/net_namespace.h -+++ b/include/net/net_namespace.h +diff -aurN linux-5.4.155/include/net/net_namespace.h mptcp-mptcp_v0.96/include/net/net_namespace.h +--- linux-5.4.155/include/net/net_namespace.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/net/net_namespace.h 2021-10-25 10:05:18.000000000 +0200 @@ -19,6 +19,7 @@ #include #include @@ -2045,7 +2026,7 @@ index 167e390ac9d4..7233acfcdb4d 100644 #include #include #include -@@ -123,6 +124,9 @@ struct net { +@@ -123,6 +124,9 @@ #if IS_ENABLED(CONFIG_IPV6) struct netns_ipv6 ipv6; #endif @@ -2055,11 +2036,9 @@ index 167e390ac9d4..7233acfcdb4d 100644 #if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN) struct netns_ieee802154_lowpan ieee802154_lowpan; #endif -diff --git a/include/net/netns/mptcp.h b/include/net/netns/mptcp.h -new file mode 100644 -index 000000000000..6680f3bbcfc8 ---- /dev/null -+++ b/include/net/netns/mptcp.h +diff -aurN linux-5.4.155/include/net/netns/mptcp.h mptcp-mptcp_v0.96/include/net/netns/mptcp.h +--- linux-5.4.155/include/net/netns/mptcp.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/include/net/netns/mptcp.h 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,52 @@ +/* + * MPTCP implementation - MPTCP namespace @@ -2113,11 +2092,10 @@ index 000000000000..6680f3bbcfc8 +}; + +#endif /* __NETNS_MPTCP_H__ */ -diff --git a/include/net/snmp.h b/include/net/snmp.h -index cb8ced4380a6..0aa0d10af2ce 100644 ---- a/include/net/snmp.h -+++ b/include/net/snmp.h -@@ -86,7 +86,6 @@ struct icmpv6msg_mib_device { +diff -aurN linux-5.4.155/include/net/snmp.h mptcp-mptcp_v0.96/include/net/snmp.h +--- linux-5.4.155/include/net/snmp.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/net/snmp.h 2021-10-25 10:05:18.000000000 +0200 +@@ -86,7 +86,6 @@ atomic_long_t mibs[ICMP6MSG_MIB_MAX]; }; @@ -2125,11 +2103,10 @@ index cb8ced4380a6..0aa0d10af2ce 100644 /* TCP */ #define TCP_MIB_MAX __TCP_MIB_MAX struct tcp_mib { -diff --git a/include/net/sock.h b/include/net/sock.h -index 079b5f6f13d8..8ae33ecd9d0a 100644 ---- a/include/net/sock.h -+++ b/include/net/sock.h -@@ -821,6 +821,7 @@ enum sock_flags { +diff -aurN linux-5.4.155/include/net/sock.h mptcp-mptcp_v0.96/include/net/sock.h +--- linux-5.4.155/include/net/sock.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/net/sock.h 2021-10-25 10:05:18.000000000 +0200 +@@ -821,6 +821,7 @@ SOCK_TXTIME, SOCK_XDP, /* XDP is attached */ SOCK_TSTAMP_NEW, /* Indicates 64 bit timestamps always */ @@ -2137,7 +2114,7 @@ index 079b5f6f13d8..8ae33ecd9d0a 100644 }; #define SK_FLAGS_TIMESTAMP ((1UL << SOCK_TIMESTAMP) | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)) -@@ -1133,6 +1134,7 @@ struct proto { +@@ -1133,6 +1134,7 @@ void (*unhash)(struct sock *sk); void (*rehash)(struct sock *sk); int (*get_port)(struct sock *sk, unsigned short snum); @@ -2145,11 +2122,10 @@ index 079b5f6f13d8..8ae33ecd9d0a 100644 /* Keeping track of sockets in use */ #ifdef CONFIG_PROC_FS -diff --git a/include/net/tcp.h b/include/net/tcp.h -index b914959cd2c6..b290be3e510c 100644 ---- a/include/net/tcp.h -+++ b/include/net/tcp.h -@@ -182,6 +182,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo); +diff -aurN linux-5.4.155/include/net/tcp.h mptcp-mptcp_v0.96/include/net/tcp.h +--- linux-5.4.155/include/net/tcp.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/net/tcp.h 2021-10-25 10:05:18.000000000 +0200 +@@ -182,6 +182,7 @@ #define TCPOPT_SACK 5 /* SACK Block */ #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ #define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ @@ -2157,7 +2133,7 @@ index b914959cd2c6..b290be3e510c 100644 #define TCPOPT_FASTOPEN 34 /* Fast open (RFC7413) */ #define TCPOPT_EXP 254 /* Experimental */ /* Magic number to be after the option value for sharing TCP -@@ -238,6 +239,31 @@ void tcp_time_wait(struct sock *sk, int state, int timeo); +@@ -238,6 +239,31 @@ */ #define TFO_SERVER_WO_SOCKOPT1 0x400 @@ -2189,7 +2165,7 @@ index b914959cd2c6..b290be3e510c 100644 /* sysctl variables for tcp */ extern int sysctl_tcp_max_orphans; -@@ -310,6 +336,98 @@ extern struct proto tcp_prot; +@@ -310,6 +336,98 @@ #define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field) #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) @@ -2288,7 +2264,7 @@ index b914959cd2c6..b290be3e510c 100644 void tcp_tasklet_init(void); int tcp_v4_err(struct sk_buff *skb, u32); -@@ -411,7 +529,9 @@ int tcp_mmap(struct file *file, struct socket *sock, +@@ -411,7 +529,9 @@ #endif void tcp_parse_options(const struct net *net, const struct sk_buff *skb, struct tcp_options_received *opt_rx, @@ -2299,7 +2275,7 @@ index b914959cd2c6..b290be3e510c 100644 const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); /* -@@ -430,6 +550,7 @@ u16 tcp_get_syncookie_mss(struct request_sock_ops *rsk_ops, +@@ -430,6 +550,7 @@ void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb); void tcp_v4_mtu_reduced(struct sock *sk); @@ -2307,7 +2283,7 @@ index b914959cd2c6..b290be3e510c 100644 void tcp_req_err(struct sock *sk, u32 seq, bool abort); int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb); struct sock *tcp_create_openreq_child(const struct sock *sk, -@@ -453,6 +574,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst, +@@ -453,6 +574,7 @@ struct request_sock *req, struct tcp_fastopen_cookie *foc, enum tcp_synack_type synack_type); @@ -2315,7 +2291,7 @@ index b914959cd2c6..b290be3e510c 100644 int tcp_disconnect(struct sock *sk, int flags); void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); -@@ -462,6 +584,7 @@ void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); +@@ -462,6 +584,7 @@ /* From syncookies.c */ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb, struct request_sock *req, @@ -2323,7 +2299,7 @@ index b914959cd2c6..b290be3e510c 100644 struct dst_entry *dst, u32 tsoff); int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th, u32 cookie); -@@ -547,7 +670,8 @@ static inline u32 tcp_cookie_time(void) +@@ -547,7 +670,8 @@ u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, u16 *mssp); @@ -2333,7 +2309,7 @@ index b914959cd2c6..b290be3e510c 100644 u64 cookie_init_timestamp(struct request_sock *req); bool cookie_timestamp_decode(const struct net *net, struct tcp_options_received *opt); -@@ -561,7 +685,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); +@@ -561,7 +685,8 @@ u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, const struct tcphdr *th, u16 *mssp); @@ -2343,7 +2319,7 @@ index b914959cd2c6..b290be3e510c 100644 #endif /* tcp_output.c */ -@@ -597,10 +722,16 @@ bool tcp_schedule_loss_probe(struct sock *sk, bool advancing_rto); +@@ -597,10 +722,16 @@ void tcp_skb_collapse_tstamp(struct sk_buff *skb, const struct sk_buff *next_skb); @@ -2360,7 +2336,7 @@ index b914959cd2c6..b290be3e510c 100644 void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb); void tcp_fin(struct sock *sk); -@@ -645,7 +776,7 @@ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) +@@ -645,7 +776,7 @@ } /* tcp.c */ @@ -2369,7 +2345,7 @@ index b914959cd2c6..b290be3e510c 100644 /* Read 'sendfile()'-style from a TCP socket */ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, -@@ -723,7 +854,7 @@ static inline u32 tcp_min_rtt(const struct tcp_sock *tp) +@@ -723,7 +854,7 @@ * Rcv_nxt can be after the window if our peer push more data * than the offered window. */ @@ -2378,7 +2354,7 @@ index b914959cd2c6..b290be3e510c 100644 { s32 win = tp->rcv_wup + tp->rcv_wnd - tp->rcv_nxt; -@@ -732,6 +863,32 @@ static inline u32 tcp_receive_window(const struct tcp_sock *tp) +@@ -732,6 +863,32 @@ return (u32) win; } @@ -2411,7 +2387,7 @@ index b914959cd2c6..b290be3e510c 100644 /* Choose a new window, without checks for shrinking, and without * scaling applied to the result. The caller does these things * if necessary. This is a "raw" window selection. -@@ -829,6 +986,12 @@ struct tcp_skb_cb { +@@ -829,6 +986,12 @@ u16 tcp_gso_size; }; }; @@ -2424,7 +2400,7 @@ index b914959cd2c6..b290be3e510c 100644 __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ __u8 sacked; /* State flags for SACK. */ -@@ -847,6 +1010,14 @@ struct tcp_skb_cb { +@@ -847,6 +1010,14 @@ has_rxtstamp:1, /* SKB has a RX timestamp */ unused:5; __u32 ack_seq; /* Sequence number ACK'd */ @@ -2439,7 +2415,7 @@ index b914959cd2c6..b290be3e510c 100644 union { struct { /* There is space for up to 24 bytes */ -@@ -1088,6 +1259,8 @@ void tcp_get_allowed_congestion_control(char *buf, size_t len); +@@ -1088,6 +1259,8 @@ int tcp_set_allowed_congestion_control(char *allowed); int tcp_set_congestion_control(struct sock *sk, const char *name, bool load, bool reinit, bool cap_net_admin); @@ -2448,7 +2424,7 @@ index b914959cd2c6..b290be3e510c 100644 u32 tcp_slow_start(struct tcp_sock *tp, u32 acked); void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w, u32 acked); -@@ -1389,6 +1562,19 @@ static inline int tcp_win_from_space(const struct sock *sk, int space) +@@ -1389,6 +1562,19 @@ space - (space>>tcp_adv_win_scale); } @@ -2468,7 +2444,7 @@ index b914959cd2c6..b290be3e510c 100644 /* Note: caller must be prepared to deal with negative returns */ static inline int tcp_space(const struct sock *sk) { -@@ -1981,6 +2167,30 @@ struct tcp_sock_af_ops { +@@ -1981,6 +2167,30 @@ #endif }; @@ -2499,7 +2475,7 @@ index b914959cd2c6..b290be3e510c 100644 struct tcp_request_sock_ops { u16 mss_clamp; #ifdef CONFIG_TCP_MD5SIG -@@ -1991,12 +2201,13 @@ struct tcp_request_sock_ops { +@@ -1991,12 +2201,13 @@ const struct sock *sk, const struct sk_buff *skb); #endif @@ -2518,7 +2494,7 @@ index b914959cd2c6..b290be3e510c 100644 #endif struct dst_entry *(*route_req)(const struct sock *sk, struct flowi *fl, const struct request_sock *req); -@@ -2010,15 +2221,17 @@ struct tcp_request_sock_ops { +@@ -2010,15 +2221,17 @@ #ifdef CONFIG_SYN_COOKIES static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops, @@ -2537,11 +2513,10 @@ index b914959cd2c6..b290be3e510c 100644 const struct sock *sk, struct sk_buff *skb, __u16 *mss) { -diff --git a/include/net/tcp_states.h b/include/net/tcp_states.h -index cc00118acca1..11084091e798 100644 ---- a/include/net/tcp_states.h -+++ b/include/net/tcp_states.h -@@ -22,6 +22,7 @@ enum { +diff -aurN linux-5.4.155/include/net/tcp_states.h mptcp-mptcp_v0.96/include/net/tcp_states.h +--- linux-5.4.155/include/net/tcp_states.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/net/tcp_states.h 2021-10-25 10:05:18.000000000 +0200 +@@ -22,6 +22,7 @@ TCP_LISTEN, TCP_CLOSING, /* Now a valid state */ TCP_NEW_SYN_RECV, @@ -2549,7 +2524,7 @@ index cc00118acca1..11084091e798 100644 TCP_MAX_STATES /* Leave at the end! */ }; -@@ -43,6 +44,7 @@ enum { +@@ -43,6 +44,7 @@ TCPF_LISTEN = (1 << TCP_LISTEN), TCPF_CLOSING = (1 << TCP_CLOSING), TCPF_NEW_SYN_RECV = (1 << TCP_NEW_SYN_RECV), @@ -2557,11 +2532,10 @@ index cc00118acca1..11084091e798 100644 }; #endif /* _LINUX_TCP_STATES_H */ -diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h -index a8f6020f1196..5e70b086fdfb 100644 ---- a/include/net/transp_v6.h -+++ b/include/net/transp_v6.h -@@ -58,6 +58,8 @@ ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp, __u16 srcp, +diff -aurN linux-5.4.155/include/net/transp_v6.h mptcp-mptcp_v0.96/include/net/transp_v6.h +--- linux-5.4.155/include/net/transp_v6.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/net/transp_v6.h 2021-10-25 10:05:18.000000000 +0200 +@@ -58,6 +58,8 @@ /* address family specific functions */ extern const struct inet_connection_sock_af_ops ipv4_specific; @@ -2570,10 +2544,9 @@ index a8f6020f1196..5e70b086fdfb 100644 void inet6_destroy_sock(struct sock *sk); -diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h -index cf97f6339acb..cf48dc87a734 100644 ---- a/include/trace/events/tcp.h -+++ b/include/trace/events/tcp.h +diff -aurN linux-5.4.155/include/trace/events/tcp.h mptcp-mptcp_v0.96/include/trace/events/tcp.h +--- linux-5.4.155/include/trace/events/tcp.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/trace/events/tcp.h 2021-10-25 10:05:18.000000000 +0200 @@ -10,6 +10,7 @@ #include #include @@ -2582,7 +2555,7 @@ index cf97f6339acb..cf48dc87a734 100644 #include #define TP_STORE_V4MAPPED(__entry, saddr, daddr) \ -@@ -181,6 +182,13 @@ DEFINE_EVENT(tcp_event_sk, tcp_rcv_space_adjust, +@@ -181,6 +182,13 @@ TP_ARGS(sk) ); @@ -2596,7 +2569,7 @@ index cf97f6339acb..cf48dc87a734 100644 TRACE_EVENT(tcp_retransmit_synack, TP_PROTO(const struct sock *sk, const struct request_sock *req), -@@ -248,6 +256,7 @@ TRACE_EVENT(tcp_probe, +@@ -248,6 +256,7 @@ __field(__u32, srtt) __field(__u32, rcv_wnd) __field(__u64, sock_cookie) @@ -2604,7 +2577,7 @@ index cf97f6339acb..cf48dc87a734 100644 ), TP_fast_assign( -@@ -274,13 +283,15 @@ TRACE_EVENT(tcp_probe, +@@ -274,13 +283,15 @@ __entry->ssthresh = tcp_current_ssthresh(sk); __entry->srtt = tp->srtt_us >> 3; __entry->sock_cookie = sock_gen_cookie(sk); @@ -2622,11 +2595,10 @@ index cf97f6339acb..cf48dc87a734 100644 ); #endif /* _TRACE_TCP_H */ -diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h -index 63038eb23560..7150eb62db86 100644 ---- a/include/uapi/linux/bpf.h -+++ b/include/uapi/linux/bpf.h -@@ -3438,6 +3438,7 @@ enum { +diff -aurN linux-5.4.155/include/uapi/linux/bpf.h mptcp-mptcp_v0.96/include/uapi/linux/bpf.h +--- linux-5.4.155/include/uapi/linux/bpf.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/uapi/linux/bpf.h 2021-10-25 10:05:18.000000000 +0200 +@@ -3438,6 +3438,7 @@ BPF_TCP_LISTEN, BPF_TCP_CLOSING, /* Now a valid state */ BPF_TCP_NEW_SYN_RECV, @@ -2634,11 +2606,10 @@ index 63038eb23560..7150eb62db86 100644 BPF_TCP_MAX_STATES /* Leave at the end! */ }; -diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h -index 7fea0fd7d6f5..7255e08393db 100644 ---- a/include/uapi/linux/if.h -+++ b/include/uapi/linux/if.h -@@ -132,6 +132,9 @@ enum net_device_flags { +diff -aurN linux-5.4.155/include/uapi/linux/if.h mptcp-mptcp_v0.96/include/uapi/linux/if.h +--- linux-5.4.155/include/uapi/linux/if.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/uapi/linux/if.h 2021-10-25 10:05:18.000000000 +0200 +@@ -132,6 +132,9 @@ #define IFF_ECHO IFF_ECHO #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ @@ -2648,11 +2619,10 @@ index 7fea0fd7d6f5..7255e08393db 100644 #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\ IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) -diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h -index 60e1241d4b77..ff6185b1d79f 100644 ---- a/include/uapi/linux/in.h -+++ b/include/uapi/linux/in.h -@@ -76,6 +76,8 @@ enum { +diff -aurN linux-5.4.155/include/uapi/linux/in.h mptcp-mptcp_v0.96/include/uapi/linux/in.h +--- linux-5.4.155/include/uapi/linux/in.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/uapi/linux/in.h 2021-10-25 10:05:18.000000000 +0200 +@@ -76,6 +76,8 @@ #define IPPROTO_MPLS IPPROTO_MPLS IPPROTO_RAW = 255, /* Raw IP packets */ #define IPPROTO_RAW IPPROTO_RAW @@ -2661,12 +2631,10 @@ index 60e1241d4b77..ff6185b1d79f 100644 IPPROTO_MAX }; #endif -diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h -new file mode 100644 -index 000000000000..02078c80c846 ---- /dev/null -+++ b/include/uapi/linux/mptcp.h -@@ -0,0 +1,151 @@ +diff -aurN linux-5.4.155/include/uapi/linux/mptcp.h mptcp-mptcp_v0.96/include/uapi/linux/mptcp.h +--- linux-5.4.155/include/uapi/linux/mptcp.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/include/uapi/linux/mptcp.h 2021-10-25 10:05:18.000000000 +0200 +@@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * Netlink API for Multipath TCP @@ -2735,20 +2703,18 @@ index 000000000000..02078c80c846 + * - MPTCP_EVENT_REMOVED: token, rem_id + * An address has been lost by the peer. + * -+ * - MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id, -+ * saddr4 | saddr6, daddr4 | daddr6, sport, -+ * dport, backup, if_idx [, error] ++ * - MPTCP_EVENT_SUB_ESTABLISHED: token, family, saddr4 | saddr6, ++ * daddr4 | daddr6, sport, dport, backup, ++ * if_idx [, error] + * A new subflow has been established. 'error' should not be set. + * -+ * - MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6, -+ * daddr4 | daddr6, sport, dport, backup, if_idx -+ * [, error] ++ * - MPTCP_EVENT_SUB_CLOSED: token, family, saddr4 | saddr6, daddr4 | daddr6, ++ * sport, dport, backup, if_idx [, error] + * A subflow has been closed. An error (copy of sk_err) could be set if an + * error has been detected for this subflow. + * -+ * - MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6, -+ * daddr4 | daddr6, sport, dport, backup, if_idx -+ * [, error] ++ * - MPTCP_EVENT_SUB_PRIORITY: token, family, saddr4 | saddr6, daddr4 | daddr6, ++ * sport, dport, backup, if_idx [, error] + * The priority of a subflow has changed. 'error' should not be set. + * + * Commands for MPTCP: @@ -2818,10 +2784,9 @@ index 000000000000..02078c80c846 +}; + +#endif /* _LINUX_MPTCP_H */ -diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h -index 81e697978e8b..09ef515261d2 100644 ---- a/include/uapi/linux/tcp.h -+++ b/include/uapi/linux/tcp.h +diff -aurN linux-5.4.155/include/uapi/linux/tcp.h mptcp-mptcp_v0.96/include/uapi/linux/tcp.h +--- linux-5.4.155/include/uapi/linux/tcp.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/include/uapi/linux/tcp.h 2021-10-25 10:05:18.000000000 +0200 @@ -18,9 +18,15 @@ #ifndef _UAPI_LINUX_TCP_H #define _UAPI_LINUX_TCP_H @@ -2839,7 +2804,7 @@ index 81e697978e8b..09ef515261d2 100644 struct tcphdr { __be16 source; -@@ -134,6 +140,13 @@ enum { +@@ -134,6 +140,13 @@ #define TCP_REPAIR_OFF 0 #define TCP_REPAIR_OFF_NO_WP -1 /* Turn off without window probes */ @@ -2853,7 +2818,7 @@ index 81e697978e8b..09ef515261d2 100644 struct tcp_repair_opt { __u32 opt_code; __u32 opt_val; -@@ -305,6 +318,53 @@ enum { +@@ -305,6 +318,53 @@ TCP_NLA_SRTT, /* smoothed RTT in usecs */ }; @@ -2907,35 +2872,10 @@ index 81e697978e8b..09ef515261d2 100644 /* for TCP_MD5SIG socket option */ #define TCP_MD5SIG_MAXKEYLEN 80 -diff --git a/net/Kconfig b/net/Kconfig -index 0b2fecc83452..66f9158a3040 100644 ---- a/net/Kconfig -+++ b/net/Kconfig -@@ -94,6 +94,7 @@ if INET - source "net/ipv4/Kconfig" - source "net/ipv6/Kconfig" - source "net/netlabel/Kconfig" -+source "net/mptcp/Kconfig" - - endif # if INET - -diff --git a/net/Makefile b/net/Makefile -index 449fc0b221f8..08683343642e 100644 ---- a/net/Makefile -+++ b/net/Makefile -@@ -20,6 +20,7 @@ obj-$(CONFIG_TLS) += tls/ - obj-$(CONFIG_XFRM) += xfrm/ - obj-$(CONFIG_UNIX_SCM) += unix/ - obj-$(CONFIG_NET) += ipv6/ -+obj-$(CONFIG_MPTCP) += mptcp/ - obj-$(CONFIG_BPFILTER) += bpfilter/ - obj-$(CONFIG_PACKET) += packet/ - obj-$(CONFIG_NET_KEY) += key/ -diff --git a/net/core/dev.c b/net/core/dev.c -index 3810eaf89b26..a8a1fba9b4ec 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -7880,7 +7880,7 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags, +diff -aurN linux-5.4.155/net/core/dev.c mptcp-mptcp_v0.96/net/core/dev.c +--- linux-5.4.155/net/core/dev.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/core/dev.c 2021-10-25 10:05:18.000000000 +0200 +@@ -7880,7 +7880,7 @@ dev->flags = (flags & (IFF_DEBUG | IFF_NOTRAILERS | IFF_NOARP | IFF_DYNAMIC | IFF_MULTICAST | IFF_PORTSEL | @@ -2944,10 +2884,9 @@ index 3810eaf89b26..a8a1fba9b4ec 100644 (dev->flags & (IFF_UP | IFF_VOLATILE | IFF_PROMISC | IFF_ALLMULTI)); -diff --git a/net/core/filter.c b/net/core/filter.c -index 0e161a6dff7e..431996bd5a16 100644 ---- a/net/core/filter.c -+++ b/net/core/filter.c +diff -aurN linux-5.4.155/net/core/filter.c mptcp-mptcp_v0.96/net/core/filter.c +--- linux-5.4.155/net/core/filter.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/core/filter.c 2021-10-25 10:05:18.000000000 +0200 @@ -73,6 +73,7 @@ #include #include @@ -2956,7 +2895,7 @@ index 0e161a6dff7e..431996bd5a16 100644 /** * sk_filter_trim_cap - run a packet through a socket filter -@@ -4280,6 +4281,19 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock, +@@ -4280,6 +4281,19 @@ if (sk->sk_mark != val) { sk->sk_mark = val; sk_dst_reset(sk); @@ -2976,7 +2915,7 @@ index 0e161a6dff7e..431996bd5a16 100644 } break; default: -@@ -4302,6 +4316,14 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock, +@@ -4302,6 +4316,14 @@ if (val == -1) val = 0; inet->tos = val; @@ -2991,7 +2930,7 @@ index 0e161a6dff7e..431996bd5a16 100644 } break; default: -@@ -4324,6 +4346,17 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock, +@@ -4324,6 +4346,17 @@ if (val == -1) val = 0; np->tclass = val; @@ -3009,21 +2948,19 @@ index 0e161a6dff7e..431996bd5a16 100644 } break; default: -diff --git a/net/core/net-traces.c b/net/core/net-traces.c -index 283ddb2dbc7d..8f526a0d1912 100644 ---- a/net/core/net-traces.c -+++ b/net/core/net-traces.c -@@ -60,3 +60,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kfree_skb); +diff -aurN linux-5.4.155/net/core/net-traces.c mptcp-mptcp_v0.96/net/core/net-traces.c +--- linux-5.4.155/net/core/net-traces.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/core/net-traces.c 2021-10-25 10:05:18.000000000 +0200 +@@ -60,3 +60,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(napi_poll); EXPORT_TRACEPOINT_SYMBOL_GPL(tcp_send_reset); + +EXPORT_TRACEPOINT_SYMBOL_GPL(mptcp_retransmit); -diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index 7dba091bc861..79ed7efe1c0c 100644 ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -582,7 +582,7 @@ static inline void skb_drop_fraglist(struct sk_buff *skb) +diff -aurN linux-5.4.155/net/core/skbuff.c mptcp-mptcp_v0.96/net/core/skbuff.c +--- linux-5.4.155/net/core/skbuff.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/core/skbuff.c 2021-10-25 10:05:18.000000000 +0200 +@@ -582,7 +582,7 @@ skb_drop_list(&skb_shinfo(skb)->frag_list); } @@ -3032,10 +2969,9 @@ index 7dba091bc861..79ed7efe1c0c 100644 { struct sk_buff *list; -diff --git a/net/core/sock.c b/net/core/sock.c -index 57b7a10703c3..8d716113e273 100644 ---- a/net/core/sock.c -+++ b/net/core/sock.c +diff -aurN linux-5.4.155/net/core/sock.c mptcp-mptcp_v0.96/net/core/sock.c +--- linux-5.4.155/net/core/sock.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/core/sock.c 2021-10-25 10:05:18.000000000 +0200 @@ -135,6 +135,11 @@ #include @@ -3048,7 +2984,7 @@ index 57b7a10703c3..8d716113e273 100644 #include #include -@@ -1063,6 +1068,19 @@ int sock_setsockopt(struct socket *sock, int level, int optname, +@@ -1063,6 +1068,19 @@ } else if (val != sk->sk_mark) { sk->sk_mark = val; sk_dst_reset(sk); @@ -3068,7 +3004,7 @@ index 57b7a10703c3..8d716113e273 100644 } break; -@@ -1563,6 +1581,23 @@ int sock_getsockopt(struct socket *sock, int level, int optname, +@@ -1563,6 +1581,23 @@ */ static inline void sock_lock_init(struct sock *sk) { @@ -3092,7 +3028,7 @@ index 57b7a10703c3..8d716113e273 100644 if (sk->sk_kern_sock) sock_lock_init_class_and_name( sk, -@@ -1611,8 +1646,12 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, +@@ -1611,8 +1646,12 @@ sk = kmem_cache_alloc(slab, priority & ~__GFP_ZERO); if (!sk) return sk; @@ -3107,7 +3043,7 @@ index 57b7a10703c3..8d716113e273 100644 } else sk = kmalloc(prot->obj_size, priority); -@@ -1846,6 +1885,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) +@@ -1846,6 +1885,7 @@ atomic_set(&newsk->sk_zckey, 0); sock_reset_flag(newsk, SOCK_DONE); @@ -3115,11 +3051,187 @@ index 57b7a10703c3..8d716113e273 100644 /* sk->sk_memcg will be populated at accept() time */ newsk->sk_memcg = NULL; -diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig -index a926de2e42b5..6d73dc6e2586 100644 ---- a/net/ipv4/Kconfig -+++ b/net/ipv4/Kconfig -@@ -655,6 +655,51 @@ config TCP_CONG_BBR +diff -aurN linux-5.4.155/net/ipv4/af_inet.c mptcp-mptcp_v0.96/net/ipv4/af_inet.c +--- linux-5.4.155/net/ipv4/af_inet.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/af_inet.c 2021-10-25 10:05:18.000000000 +0200 +@@ -100,6 +100,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -150,6 +151,9 @@ + return; + } + ++ if (sock_flag(sk, SOCK_MPTCP)) ++ mptcp_disable_static_key(); ++ + WARN_ON(atomic_read(&sk->sk_rmem_alloc)); + WARN_ON(refcount_read(&sk->sk_wmem_alloc)); + WARN_ON(sk->sk_wmem_queued); +@@ -227,6 +231,8 @@ + tcp_fastopen_init_key_once(sock_net(sk)); + } + ++ mptcp_init_listen(sk); ++ + err = inet_csk_listen_start(sk, backlog); + if (err) + goto out; +@@ -244,8 +250,7 @@ + * Create an inet socket. + */ + +-static int inet_create(struct net *net, struct socket *sock, int protocol, +- int kern) ++int inet_create(struct net *net, struct socket *sock, int protocol, int kern) + { + struct sock *sk; + struct inet_protosw *answer; +@@ -739,6 +744,24 @@ + lock_sock(sk2); + + sock_rps_record_flow(sk2); ++ ++ if (sk2->sk_protocol == IPPROTO_TCP && mptcp(tcp_sk(sk2))) { ++ struct mptcp_tcp_sock *mptcp; ++ ++ mptcp_for_each_sub(tcp_sk(sk2)->mpcb, mptcp) { ++ sock_rps_record_flow(mptcp_to_sock(mptcp)); ++ } ++ ++ if (tcp_sk(sk2)->mpcb->master_sk) { ++ struct sock *sk_it = tcp_sk(sk2)->mpcb->master_sk; ++ ++ write_lock_bh(&sk_it->sk_callback_lock); ++ rcu_assign_pointer(sk_it->sk_wq, &newsock->wq); ++ sk_it->sk_socket = newsock; ++ write_unlock_bh(&sk_it->sk_callback_lock); ++ } ++ } ++ + WARN_ON(!((1 << sk2->sk_state) & + (TCPF_ESTABLISHED | TCPF_SYN_RECV | + TCPF_CLOSE_WAIT | TCPF_CLOSE))); +@@ -1974,6 +1997,9 @@ + + ip_init(); + ++ /* We must initialize MPTCP before TCP. */ ++ mptcp_init(); ++ + /* Setup TCP slab cache for open requests. */ + tcp_init(); + +diff -aurN linux-5.4.155/net/ipv4/inet_connection_sock.c mptcp-mptcp_v0.96/net/ipv4/inet_connection_sock.c +--- linux-5.4.155/net/ipv4/inet_connection_sock.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/inet_connection_sock.c 2021-10-25 10:05:18.000000000 +0200 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -730,7 +731,10 @@ + int max_retries, thresh; + u8 defer_accept; + +- if (inet_sk_state_load(sk_listener) != TCP_LISTEN) ++ if (!is_meta_sk(sk_listener) && inet_sk_state_load(sk_listener) != TCP_LISTEN) ++ goto drop; ++ ++ if (is_meta_sk(sk_listener) && !mptcp_can_new_subflow(sk_listener)) + goto drop; + + max_retries = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_synack_retries; +@@ -819,7 +823,9 @@ + const struct request_sock *req, + const gfp_t priority) + { +- struct sock *newsk = sk_clone_lock(sk, priority); ++ struct sock *newsk; ++ ++ newsk = sk_clone_lock(sk, priority); + + if (newsk) { + struct inet_connection_sock *newicsk = inet_csk(newsk); +@@ -1019,7 +1025,14 @@ + */ + while ((req = reqsk_queue_remove(queue, sk)) != NULL) { + struct sock *child = req->sk; ++ bool mutex_taken = false; ++ struct mptcp_cb *mpcb = tcp_sk(child)->mpcb; + ++ if (is_meta_sk(child)) { ++ WARN_ON(refcount_inc_not_zero(&mpcb->mpcb_refcnt) == 0); ++ mutex_lock(&mpcb->mpcb_mutex); ++ mutex_taken = true; ++ } + local_bh_disable(); + bh_lock_sock(child); + WARN_ON(sock_owned_by_user(child)); +@@ -1029,6 +1042,10 @@ + reqsk_put(req); + bh_unlock_sock(child); + local_bh_enable(); ++ if (mutex_taken) { ++ mutex_unlock(&mpcb->mpcb_mutex); ++ mptcp_mpcb_put(mpcb); ++ } + sock_put(child); + + cond_resched(); +diff -aurN linux-5.4.155/net/ipv4/ip_sockglue.c mptcp-mptcp_v0.96/net/ipv4/ip_sockglue.c +--- linux-5.4.155/net/ipv4/ip_sockglue.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/ip_sockglue.c 2021-10-25 10:05:18.000000000 +0200 +@@ -44,6 +44,8 @@ + #endif + #include + ++#include ++ + #include + #include + +@@ -657,7 +659,7 @@ + break; + old = rcu_dereference_protected(inet->inet_opt, + lockdep_sock_is_held(sk)); +- if (inet->is_icsk) { ++ if (inet->is_icsk && !is_meta_sk(sk)) { + struct inet_connection_sock *icsk = inet_csk(sk); + #if IS_ENABLED(CONFIG_IPV6) + if (sk->sk_family == PF_INET || +@@ -751,6 +753,20 @@ + inet->tos = val; + sk->sk_priority = rt_tos2priority(val); + sk_dst_reset(sk); ++ /* Update TOS on mptcp subflow */ ++ if (is_meta_sk(sk)) { ++ struct mptcp_tcp_sock *mptcp; ++ ++ mptcp_for_each_sub(tcp_sk(sk)->mpcb, mptcp) { ++ struct sock *sk_it = mptcp_to_sock(mptcp); ++ ++ if (inet_sk(sk_it)->tos != inet_sk(sk)->tos) { ++ inet_sk(sk_it)->tos = inet_sk(sk)->tos; ++ sk_it->sk_priority = sk->sk_priority; ++ sk_dst_reset(sk_it); ++ } ++ } ++ } + } + break; + case IP_TTL: +diff -aurN linux-5.4.155/net/ipv4/Kconfig mptcp-mptcp_v0.96/net/ipv4/Kconfig +--- linux-5.4.155/net/ipv4/Kconfig 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/Kconfig 2021-10-25 10:05:18.000000000 +0200 +@@ -655,6 +655,51 @@ bufferbloat, policers, or AQM schemes that do not provide a delay signal. It requires the fq ("Fair Queue") pacing packet scheduler. @@ -3171,7 +3283,7 @@ index a926de2e42b5..6d73dc6e2586 100644 choice prompt "Default TCP congestion control" default DEFAULT_CUBIC -@@ -692,6 +737,21 @@ choice +@@ -692,6 +737,21 @@ config DEFAULT_BBR bool "BBR" if TCP_CONG_BBR=y @@ -3193,7 +3305,7 @@ index a926de2e42b5..6d73dc6e2586 100644 config DEFAULT_RENO bool "Reno" endchoice -@@ -712,6 +772,10 @@ config DEFAULT_TCP_CONG +@@ -712,6 +772,10 @@ default "vegas" if DEFAULT_VEGAS default "westwood" if DEFAULT_WESTWOOD default "veno" if DEFAULT_VENO @@ -3204,190 +3316,9 @@ index a926de2e42b5..6d73dc6e2586 100644 default "reno" if DEFAULT_RENO default "dctcp" if DEFAULT_DCTCP default "cdg" if DEFAULT_CDG -diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c -index 70f92aaca411..0f4633257c75 100644 ---- a/net/ipv4/af_inet.c -+++ b/net/ipv4/af_inet.c -@@ -100,6 +100,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -150,6 +151,9 @@ void inet_sock_destruct(struct sock *sk) - return; - } - -+ if (sock_flag(sk, SOCK_MPTCP)) -+ mptcp_disable_static_key(); -+ - WARN_ON(atomic_read(&sk->sk_rmem_alloc)); - WARN_ON(refcount_read(&sk->sk_wmem_alloc)); - WARN_ON(sk->sk_wmem_queued); -@@ -227,6 +231,8 @@ int inet_listen(struct socket *sock, int backlog) - tcp_fastopen_init_key_once(sock_net(sk)); - } - -+ mptcp_init_listen(sk); -+ - err = inet_csk_listen_start(sk, backlog); - if (err) - goto out; -@@ -244,8 +250,7 @@ EXPORT_SYMBOL(inet_listen); - * Create an inet socket. - */ - --static int inet_create(struct net *net, struct socket *sock, int protocol, -- int kern) -+int inet_create(struct net *net, struct socket *sock, int protocol, int kern) - { - struct sock *sk; - struct inet_protosw *answer; -@@ -739,6 +744,24 @@ int inet_accept(struct socket *sock, struct socket *newsock, int flags, - lock_sock(sk2); - - sock_rps_record_flow(sk2); -+ -+ if (sk2->sk_protocol == IPPROTO_TCP && mptcp(tcp_sk(sk2))) { -+ struct mptcp_tcp_sock *mptcp; -+ -+ mptcp_for_each_sub(tcp_sk(sk2)->mpcb, mptcp) { -+ sock_rps_record_flow(mptcp_to_sock(mptcp)); -+ } -+ -+ if (tcp_sk(sk2)->mpcb->master_sk) { -+ struct sock *sk_it = tcp_sk(sk2)->mpcb->master_sk; -+ -+ write_lock_bh(&sk_it->sk_callback_lock); -+ rcu_assign_pointer(sk_it->sk_wq, &newsock->wq); -+ sk_it->sk_socket = newsock; -+ write_unlock_bh(&sk_it->sk_callback_lock); -+ } -+ } -+ - WARN_ON(!((1 << sk2->sk_state) & - (TCPF_ESTABLISHED | TCPF_SYN_RECV | - TCPF_CLOSE_WAIT | TCPF_CLOSE))); -@@ -1974,6 +1997,9 @@ static int __init inet_init(void) - - ip_init(); - -+ /* We must initialize MPTCP before TCP. */ -+ mptcp_init(); -+ - /* Setup TCP slab cache for open requests. */ - tcp_init(); - -diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c -index 85a88425edc4..f3de2d6eb1a4 100644 ---- a/net/ipv4/inet_connection_sock.c -+++ b/net/ipv4/inet_connection_sock.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -730,7 +731,10 @@ static void reqsk_timer_handler(struct timer_list *t) - int max_retries, thresh; - u8 defer_accept; - -- if (inet_sk_state_load(sk_listener) != TCP_LISTEN) -+ if (!is_meta_sk(sk_listener) && inet_sk_state_load(sk_listener) != TCP_LISTEN) -+ goto drop; -+ -+ if (is_meta_sk(sk_listener) && !mptcp_can_new_subflow(sk_listener)) - goto drop; - - max_retries = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_synack_retries; -@@ -819,7 +823,9 @@ struct sock *inet_csk_clone_lock(const struct sock *sk, - const struct request_sock *req, - const gfp_t priority) - { -- struct sock *newsk = sk_clone_lock(sk, priority); -+ struct sock *newsk; -+ -+ newsk = sk_clone_lock(sk, priority); - - if (newsk) { - struct inet_connection_sock *newicsk = inet_csk(newsk); -@@ -1019,7 +1025,14 @@ void inet_csk_listen_stop(struct sock *sk) - */ - while ((req = reqsk_queue_remove(queue, sk)) != NULL) { - struct sock *child = req->sk; -+ bool mutex_taken = false; -+ struct mptcp_cb *mpcb = tcp_sk(child)->mpcb; - -+ if (is_meta_sk(child)) { -+ WARN_ON(refcount_inc_not_zero(&mpcb->mpcb_refcnt) == 0); -+ mutex_lock(&mpcb->mpcb_mutex); -+ mutex_taken = true; -+ } - local_bh_disable(); - bh_lock_sock(child); - WARN_ON(sock_owned_by_user(child)); -@@ -1029,6 +1042,10 @@ void inet_csk_listen_stop(struct sock *sk) - reqsk_put(req); - bh_unlock_sock(child); - local_bh_enable(); -+ if (mutex_taken) { -+ mutex_unlock(&mpcb->mpcb_mutex); -+ mptcp_mpcb_put(mpcb); -+ } - sock_put(child); - - cond_resched(); -diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c -index aa3fd61818c4..8b3e955ec165 100644 ---- a/net/ipv4/ip_sockglue.c -+++ b/net/ipv4/ip_sockglue.c -@@ -44,6 +44,8 @@ - #endif - #include - -+#include -+ - #include - #include - -@@ -657,7 +659,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, - break; - old = rcu_dereference_protected(inet->inet_opt, - lockdep_sock_is_held(sk)); -- if (inet->is_icsk) { -+ if (inet->is_icsk && !is_meta_sk(sk)) { - struct inet_connection_sock *icsk = inet_csk(sk); - #if IS_ENABLED(CONFIG_IPV6) - if (sk->sk_family == PF_INET || -@@ -751,6 +753,20 @@ static int do_ip_setsockopt(struct sock *sk, int level, - inet->tos = val; - sk->sk_priority = rt_tos2priority(val); - sk_dst_reset(sk); -+ /* Update TOS on mptcp subflow */ -+ if (is_meta_sk(sk)) { -+ struct mptcp_tcp_sock *mptcp; -+ -+ mptcp_for_each_sub(tcp_sk(sk)->mpcb, mptcp) { -+ struct sock *sk_it = mptcp_to_sock(mptcp); -+ -+ if (inet_sk(sk_it)->tos != inet_sk(sk)->tos) { -+ inet_sk(sk_it)->tos = inet_sk(sk)->tos; -+ sk_it->sk_priority = sk->sk_priority; -+ sk_dst_reset(sk_it); -+ } -+ } -+ } - } - break; - case IP_TTL: -diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c -index 2b45d1455592..f988be944eda 100644 ---- a/net/ipv4/syncookies.c -+++ b/net/ipv4/syncookies.c +diff -aurN linux-5.4.155/net/ipv4/syncookies.c mptcp-mptcp_v0.96/net/ipv4/syncookies.c +--- linux-5.4.155/net/ipv4/syncookies.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/syncookies.c 2021-10-25 10:05:18.000000000 +0200 @@ -12,6 +12,8 @@ #include #include @@ -3397,7 +3328,7 @@ index 2b45d1455592..f988be944eda 100644 #include #include #include -@@ -175,7 +177,8 @@ u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, +@@ -175,7 +177,8 @@ } EXPORT_SYMBOL_GPL(__cookie_v4_init_sequence); @@ -3407,7 +3338,7 @@ index 2b45d1455592..f988be944eda 100644 { const struct iphdr *iph = ip_hdr(skb); const struct tcphdr *th = tcp_hdr(skb); -@@ -200,14 +203,33 @@ EXPORT_SYMBOL_GPL(__cookie_v4_check); +@@ -200,14 +203,33 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb, struct request_sock *req, @@ -3441,7 +3372,7 @@ index 2b45d1455592..f988be944eda 100644 if (child) { refcount_set(&req->rsk_refcnt, 1); tcp_sk(child)->tsoffset = tsoff; -@@ -284,6 +306,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -284,6 +306,7 @@ { struct ip_options *opt = &TCP_SKB_CB(skb)->header.h4.opt; struct tcp_options_received tcp_opt; @@ -3449,7 +3380,7 @@ index 2b45d1455592..f988be944eda 100644 struct inet_request_sock *ireq; struct tcp_request_sock *treq; struct tcp_sock *tp = tcp_sk(sk); -@@ -313,7 +336,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -313,7 +336,8 @@ /* check for timestamp cookie support */ memset(&tcp_opt, 0, sizeof(tcp_opt)); @@ -3459,7 +3390,7 @@ index 2b45d1455592..f988be944eda 100644 if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) { tsoff = secure_tcp_ts_off(sock_net(sk), -@@ -326,7 +350,12 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -326,7 +350,12 @@ goto out; ret = NULL; @@ -3473,7 +3404,7 @@ index 2b45d1455592..f988be944eda 100644 if (!req) goto out; -@@ -346,6 +375,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -346,6 +375,8 @@ ireq->sack_ok = tcp_opt.sack_ok; ireq->wscale_ok = tcp_opt.wscale_ok; ireq->tstamp_ok = tcp_opt.saw_tstamp; @@ -3482,7 +3413,7 @@ index 2b45d1455592..f988be944eda 100644 req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0; treq->snt_synack = 0; treq->tfo_listener = false; -@@ -354,6 +385,9 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -354,6 +385,9 @@ ireq->ir_iif = inet_request_bound_dev_if(sk, skb); @@ -3492,7 +3423,7 @@ index 2b45d1455592..f988be944eda 100644 /* We throwed the options of the initial SYN away, so we hope * the ACK carries the same options again (see RFC1122 4.2.3.8) */ -@@ -392,15 +426,15 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -392,15 +426,15 @@ (req->rsk_window_clamp > full_space || req->rsk_window_clamp == 0)) req->rsk_window_clamp = full_space; @@ -3513,10 +3444,9 @@ index 2b45d1455592..f988be944eda 100644 /* ip_queue_xmit() depends on our flow being setup * Normal sockets get it right from inet_csk_route_child_sock() */ -diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c -index 5c8d0fb49825..19fbc2cebb07 100644 ---- a/net/ipv4/tcp.c -+++ b/net/ipv4/tcp.c +diff -aurN linux-5.4.155/net/ipv4/tcp.c mptcp-mptcp_v0.96/net/ipv4/tcp.c +--- linux-5.4.155/net/ipv4/tcp.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/tcp.c 2021-10-25 10:05:18.000000000 +0200 @@ -270,6 +270,7 @@ #include @@ -3525,7 +3455,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 #include #include #include -@@ -400,6 +401,23 @@ static u64 tcp_compute_delivery_rate(const struct tcp_sock *tp) +@@ -400,6 +401,23 @@ return rate64; } @@ -3549,7 +3479,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 /* Address-family independent initialization for a tcp_sock. * * NOTE: A lot of things set to zero explicitly by call to -@@ -453,6 +471,11 @@ void tcp_init_sock(struct sock *sk) +@@ -453,6 +471,11 @@ WRITE_ONCE(sk->sk_sndbuf, sock_net(sk)->ipv4.sysctl_tcp_wmem[1]); WRITE_ONCE(sk->sk_rcvbuf, sock_net(sk)->ipv4.sysctl_tcp_rmem[1]); @@ -3561,7 +3491,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 sk_sockets_allocated_inc(sk); sk->sk_route_forced_caps = NETIF_F_GSO; } -@@ -484,7 +507,7 @@ static inline bool tcp_stream_is_readable(const struct tcp_sock *tp, +@@ -484,7 +507,7 @@ return true; if (tcp_rmem_pressure(sk)) return true; @@ -3570,7 +3500,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 return true; } if (sk->sk_prot->stream_memory_read) -@@ -787,6 +810,7 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, +@@ -787,6 +810,7 @@ int ret; sock_rps_record_flow(sk); @@ -3578,7 +3508,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 /* * We can't seek on a socket input */ -@@ -797,6 +821,16 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, +@@ -797,6 +821,16 @@ lock_sock(sk); @@ -3595,7 +3525,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 timeo = sock_rcvtimeo(sk, sock->file->f_flags & O_NONBLOCK); while (tss.len) { ret = __tcp_splice_read(sk, &tss); -@@ -912,8 +946,7 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp, +@@ -912,8 +946,7 @@ return NULL; } @@ -3605,7 +3535,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 { struct tcp_sock *tp = tcp_sk(sk); u32 new_size_goal, size_goal; -@@ -941,8 +974,13 @@ static int tcp_send_mss(struct sock *sk, int *size_goal, int flags) +@@ -941,8 +974,13 @@ { int mss_now; @@ -3621,7 +3551,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 return mss_now; } -@@ -982,12 +1020,34 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, +@@ -982,12 +1020,34 @@ * is fully established. */ if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) && @@ -3657,7 +3587,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk); mss_now = tcp_send_mss(sk, &size_goal, flags); -@@ -1109,7 +1169,8 @@ EXPORT_SYMBOL_GPL(do_tcp_sendpages); +@@ -1109,7 +1169,8 @@ int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset, size_t size, int flags) { @@ -3667,7 +3597,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 return sock_no_sendpage_locked(sk, page, offset, size, flags); tcp_rate_check_app_limited(sk); /* is sending application-limited? */ -@@ -1231,12 +1292,21 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) +@@ -1231,12 +1292,21 @@ * is fully established. */ if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) && @@ -3690,7 +3620,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 if (unlikely(tp->repair)) { if (tp->repair_queue == TCP_RECV_QUEUE) { copied = tcp_send_rcvq(sk, msg, size); -@@ -1529,7 +1599,7 @@ static int tcp_peek_sndq(struct sock *sk, struct msghdr *msg, int len) +@@ -1529,7 +1599,7 @@ * calculation of whether or not we must ACK for the sake of * a window update. */ @@ -3699,7 +3629,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 { struct tcp_sock *tp = tcp_sk(sk); bool time_to_ack = false; -@@ -1568,11 +1638,11 @@ static void tcp_cleanup_rbuf(struct sock *sk, int copied) +@@ -1568,11 +1638,11 @@ * in states, where we will not receive more. It is useless. */ if (copied > 0 && !time_to_ack && !(sk->sk_shutdown & RCV_SHUTDOWN)) { @@ -3713,7 +3643,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 /* Send ACK now, if this read freed lots of space * in our buffer. Certainly, new_window is new window. -@@ -1688,7 +1758,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, +@@ -1688,7 +1758,7 @@ /* Clean up data we have read: This will do ACK frames. */ if (copied > 0) { tcp_recv_skb(sk, seq, &offset); @@ -3722,7 +3652,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 } return copied; } -@@ -1979,6 +2049,16 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, +@@ -1979,6 +2049,16 @@ lock_sock(sk); @@ -3739,7 +3669,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 err = -ENOTCONN; if (sk->sk_state == TCP_LISTEN) goto out; -@@ -2097,7 +2177,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, +@@ -2097,7 +2177,7 @@ } } @@ -3748,7 +3678,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 if (copied >= target) { /* Do not sleep, just process backlog. */ -@@ -2189,7 +2269,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, +@@ -2189,7 +2269,7 @@ */ /* Clean up data we have read: This will do ACK frames. */ @@ -3757,7 +3687,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 release_sock(sk); -@@ -2248,8 +2328,11 @@ void tcp_set_state(struct sock *sk, int state) +@@ -2248,8 +2328,11 @@ switch (state) { case TCP_ESTABLISHED: @@ -3770,7 +3700,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 break; case TCP_CLOSE: -@@ -2262,8 +2345,11 @@ void tcp_set_state(struct sock *sk, int state) +@@ -2262,8 +2345,11 @@ inet_put_port(sk); /* fall through */ default: @@ -3783,7 +3713,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 } /* Change state AFTER socket is unhashed to avoid closed -@@ -2297,7 +2383,7 @@ static const unsigned char new_state[16] = { +@@ -2297,7 +2383,7 @@ [TCP_NEW_SYN_RECV] = TCP_CLOSE, /* should not happen ! */ }; @@ -3792,7 +3722,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 { int next = (int)new_state[sk->sk_state]; int ns = next & TCP_STATE_MASK; -@@ -2327,7 +2413,7 @@ void tcp_shutdown(struct sock *sk, int how) +@@ -2327,7 +2413,7 @@ TCPF_SYN_RECV | TCPF_CLOSE_WAIT)) { /* Clear out any half completed packets. FIN if needed. */ if (tcp_close_state(sk)) @@ -3801,7 +3731,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 } } EXPORT_SYMBOL(tcp_shutdown); -@@ -2352,6 +2438,17 @@ void tcp_close(struct sock *sk, long timeout) +@@ -2352,6 +2438,17 @@ int data_was_unread = 0; int state; @@ -3819,7 +3749,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 lock_sock(sk); sk->sk_shutdown = SHUTDOWN_MASK; -@@ -2396,7 +2493,7 @@ void tcp_close(struct sock *sk, long timeout) +@@ -2396,7 +2493,7 @@ /* Unread data was tossed, zap the connection. */ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONCLOSE); tcp_set_state(sk, TCP_CLOSE); @@ -3828,7 +3758,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 } else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) { /* Check zero linger _after_ checking for unread data. */ sk->sk_prot->disconnect(sk, 0); -@@ -2470,7 +2567,7 @@ void tcp_close(struct sock *sk, long timeout) +@@ -2470,7 +2567,7 @@ struct tcp_sock *tp = tcp_sk(sk); if (tp->linger2 < 0) { tcp_set_state(sk, TCP_CLOSE); @@ -3837,7 +3767,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONLINGER); } else { -@@ -2480,7 +2577,8 @@ void tcp_close(struct sock *sk, long timeout) +@@ -2480,7 +2577,8 @@ inet_csk_reset_keepalive_timer(sk, tmo - TCP_TIMEWAIT_LEN); } else { @@ -3847,7 +3777,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 goto out; } } -@@ -2489,7 +2587,7 @@ void tcp_close(struct sock *sk, long timeout) +@@ -2489,7 +2587,7 @@ sk_mem_reclaim(sk); if (tcp_check_oom(sk, 0)) { tcp_set_state(sk, TCP_CLOSE); @@ -3856,7 +3786,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY); } else if (!check_net(sock_net(sk))) { -@@ -2521,15 +2619,6 @@ void tcp_close(struct sock *sk, long timeout) +@@ -2521,15 +2619,6 @@ } EXPORT_SYMBOL(tcp_close); @@ -3872,7 +3802,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 static void tcp_rtx_queue_purge(struct sock *sk) { struct rb_node *p = rb_first(&sk->tcp_rtx_queue); -@@ -2551,6 +2640,10 @@ void tcp_write_queue_purge(struct sock *sk) +@@ -2551,6 +2640,10 @@ { struct sk_buff *skb; @@ -3883,7 +3813,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 tcp_chrono_stop(sk, TCP_CHRONO_BUSY); while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) { tcp_skb_tsorted_anchor_cleanup(skb); -@@ -2569,6 +2662,36 @@ void tcp_write_queue_purge(struct sock *sk) +@@ -2569,6 +2662,36 @@ inet_csk(sk)->icsk_backoff = 0; } @@ -3920,7 +3850,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 int tcp_disconnect(struct sock *sk, int flags) { struct inet_sock *inet = inet_sk(sk); -@@ -2591,7 +2714,7 @@ int tcp_disconnect(struct sock *sk, int flags) +@@ -2591,7 +2714,7 @@ /* The last check adjusts for discrepancy of Linux wrt. RFC * states */ @@ -3929,7 +3859,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 sk->sk_err = ECONNRESET; } else if (old_state == TCP_SYN_SENT) sk->sk_err = ECONNRESET; -@@ -2613,11 +2736,15 @@ int tcp_disconnect(struct sock *sk, int flags) +@@ -2613,11 +2736,15 @@ if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK)) inet_reset_saddr(sk); @@ -3948,7 +3878,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 seq = tp->write_seq + tp->max_window + 2; if (!seq) -@@ -2627,21 +2754,14 @@ int tcp_disconnect(struct sock *sk, int flags) +@@ -2627,21 +2754,14 @@ icsk->icsk_backoff = 0; tp->snd_cwnd = 2; icsk->icsk_probes_out = 0; @@ -3973,7 +3903,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 inet_csk_delack_init(sk); /* Initialize rcv_mss to TCP_MIN_MSS to avoid division by 0 * issue in __tcp_select_window() -@@ -2653,14 +2773,6 @@ int tcp_disconnect(struct sock *sk, int flags) +@@ -2653,14 +2773,6 @@ sk->sk_rx_dst = NULL; tcp_saved_syn_free(tp); tp->compressed_ack = 0; @@ -3988,7 +3918,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 tp->duplicate_sack[0].start_seq = 0; tp->duplicate_sack[0].end_seq = 0; tp->dsack_dups = 0; -@@ -2669,8 +2781,6 @@ int tcp_disconnect(struct sock *sk, int flags) +@@ -2669,8 +2781,6 @@ tp->sacked_out = 0; tp->tlp_high_seq = 0; tp->last_oow_ack_time = 0; @@ -3997,7 +3927,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 tp->rack.mstamp = 0; tp->rack.advanced = 0; tp->rack.reo_wnd_steps = 1; -@@ -2704,7 +2814,7 @@ EXPORT_SYMBOL(tcp_disconnect); +@@ -2704,7 +2814,7 @@ static inline bool tcp_can_repair_sock(const struct sock *sk) { return ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) && @@ -4006,7 +3936,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 } static int tcp_repair_set_window(struct tcp_sock *tp, char __user *optbuf, int len) -@@ -2735,6 +2845,7 @@ static int tcp_repair_set_window(struct tcp_sock *tp, char __user *optbuf, int l +@@ -2735,6 +2845,7 @@ tp->rcv_wnd = opt.rcv_wnd; tp->rcv_wup = opt.rcv_wup; @@ -4014,7 +3944,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 return 0; } -@@ -2873,6 +2984,61 @@ static int do_tcp_setsockopt(struct sock *sk, int level, +@@ -2873,6 +2984,61 @@ return tcp_fastopen_reset_cipher(net, sk, key, backup_key); } @@ -4076,7 +4006,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 default: /* fallthru */ break; -@@ -3062,6 +3228,12 @@ static int do_tcp_setsockopt(struct sock *sk, int level, +@@ -3062,6 +3228,12 @@ break; case TCP_DEFER_ACCEPT: @@ -4089,7 +4019,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 /* Translate value in seconds to number of retransmits */ icsk->icsk_accept_queue.rskq_defer_accept = secs_to_retrans(val, TCP_TIMEOUT_INIT / HZ, -@@ -3089,7 +3261,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, +@@ -3089,7 +3261,7 @@ (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT) && inet_csk_ack_scheduled(sk)) { icsk->icsk_ack.pending |= ICSK_ACK_PUSHED; @@ -4098,7 +4028,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 if (!(val & 1)) inet_csk_enter_pingpong_mode(sk); } -@@ -3099,7 +3271,10 @@ static int do_tcp_setsockopt(struct sock *sk, int level, +@@ -3099,7 +3271,10 @@ #ifdef CONFIG_TCP_MD5SIG case TCP_MD5SIG: case TCP_MD5SIG_EXT: @@ -4110,7 +4040,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 break; #endif case TCP_USER_TIMEOUT: -@@ -3155,6 +3330,32 @@ static int do_tcp_setsockopt(struct sock *sk, int level, +@@ -3155,6 +3330,32 @@ tp->notsent_lowat = val; sk->sk_write_space(sk); break; @@ -4143,7 +4073,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 case TCP_INQ: if (val > 1 || val < 0) err = -EINVAL; -@@ -3219,7 +3420,7 @@ static void tcp_get_info_chrono_stats(const struct tcp_sock *tp, +@@ -3219,7 +3420,7 @@ } /* Return information about state of tcp endpoint in API format. */ @@ -4152,7 +4082,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 { const struct tcp_sock *tp = tcp_sk(sk); /* iff sk_type == SOCK_STREAM */ const struct inet_connection_sock *icsk = inet_csk(sk); -@@ -3256,7 +3457,8 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info) +@@ -3256,7 +3457,8 @@ return; } @@ -4162,7 +4092,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 info->tcpi_ca_state = icsk->icsk_ca_state; info->tcpi_retransmits = icsk->icsk_retransmits; -@@ -3332,7 +3534,9 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info) +@@ -3332,7 +3534,9 @@ info->tcpi_reord_seen = tp->reord_seen; info->tcpi_rcv_ooopack = tp->rcv_ooopack; info->tcpi_snd_wnd = tp->snd_wnd; @@ -4173,7 +4103,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 } EXPORT_SYMBOL_GPL(tcp_get_info); -@@ -3479,7 +3683,7 @@ static int do_tcp_getsockopt(struct sock *sk, int level, +@@ -3479,7 +3683,7 @@ if (get_user(len, optlen)) return -EFAULT; @@ -4182,7 +4112,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 len = min_t(unsigned int, len, sizeof(info)); if (put_user(len, optlen)) -@@ -3668,6 +3872,87 @@ static int do_tcp_getsockopt(struct sock *sk, int level, +@@ -3668,6 +3872,87 @@ } return 0; } @@ -4270,7 +4200,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 #ifdef CONFIG_MMU case TCP_ZEROCOPY_RECEIVE: { struct tcp_zerocopy_receive zc; -@@ -3873,7 +4158,9 @@ void tcp_done(struct sock *sk) +@@ -3873,7 +4158,9 @@ if (sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV) TCP_INC_STATS(sock_net(sk), TCP_MIB_ATTEMPTFAILS); @@ -4280,7 +4210,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 tcp_clear_xmit_timers(sk); if (req) reqsk_fastopen_remove(sk, req, false); -@@ -3889,6 +4176,8 @@ EXPORT_SYMBOL_GPL(tcp_done); +@@ -3889,6 +4176,8 @@ int tcp_abort(struct sock *sk, int err) { @@ -4289,7 +4219,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 if (!sk_fullsock(sk)) { if (sk->sk_state == TCP_NEW_SYN_RECV) { struct request_sock *req = inet_reqsk(sk); -@@ -3902,7 +4191,7 @@ int tcp_abort(struct sock *sk, int err) +@@ -3902,7 +4191,7 @@ } /* Don't race with userspace socket closes such as tcp_close. */ @@ -4298,7 +4228,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 if (sk->sk_state == TCP_LISTEN) { tcp_set_state(sk, TCP_CLOSE); -@@ -3911,7 +4200,7 @@ int tcp_abort(struct sock *sk, int err) +@@ -3911,7 +4200,7 @@ /* Don't race with BH socket closes such as inet_csk_listen_stop. */ local_bh_disable(); @@ -4307,7 +4237,7 @@ index 5c8d0fb49825..19fbc2cebb07 100644 if (!sock_flag(sk, SOCK_DEAD)) { sk->sk_err = err; -@@ -3919,14 +4208,14 @@ int tcp_abort(struct sock *sk, int err) +@@ -3919,14 +4208,14 @@ smp_wmb(); sk->sk_error_report(sk); if (tcp_need_reset(sk->sk_state)) @@ -4325,11 +4255,10 @@ index 5c8d0fb49825..19fbc2cebb07 100644 return 0; } EXPORT_SYMBOL_GPL(tcp_abort); -diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c -index 6d5600889dcf..247c1168b6a5 100644 ---- a/net/ipv4/tcp_cong.c -+++ b/net/ipv4/tcp_cong.c -@@ -337,13 +337,19 @@ int tcp_set_allowed_congestion_control(char *val) +diff -aurN linux-5.4.155/net/ipv4/tcp_cong.c mptcp-mptcp_v0.96/net/ipv4/tcp_cong.c +--- linux-5.4.155/net/ipv4/tcp_cong.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/tcp_cong.c 2021-10-25 10:05:18.000000000 +0200 +@@ -337,13 +337,19 @@ return ret; } @@ -4351,11 +4280,10 @@ index 6d5600889dcf..247c1168b6a5 100644 { struct inet_connection_sock *icsk = inet_csk(sk); const struct tcp_congestion_ops *ca; -diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c -index 549506162dde..e5a530e0b1c5 100644 ---- a/net/ipv4/tcp_diag.c -+++ b/net/ipv4/tcp_diag.c -@@ -31,7 +31,7 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r, +diff -aurN linux-5.4.155/net/ipv4/tcp_diag.c mptcp-mptcp_v0.96/net/ipv4/tcp_diag.c +--- linux-5.4.155/net/ipv4/tcp_diag.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/tcp_diag.c 2021-10-25 10:05:18.000000000 +0200 +@@ -31,7 +31,7 @@ r->idiag_wqueue = READ_ONCE(tp->write_seq) - tp->snd_una; } if (info) @@ -4364,10 +4292,9 @@ index 549506162dde..e5a530e0b1c5 100644 } #ifdef CONFIG_TCP_MD5SIG -diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c -index a5ec77a5ad6f..f9fb4a268b9b 100644 ---- a/net/ipv4/tcp_fastopen.c -+++ b/net/ipv4/tcp_fastopen.c +diff -aurN linux-5.4.155/net/ipv4/tcp_fastopen.c mptcp-mptcp_v0.96/net/ipv4/tcp_fastopen.c +--- linux-5.4.155/net/ipv4/tcp_fastopen.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/tcp_fastopen.c 2021-10-25 10:05:18.000000000 +0200 @@ -9,6 +9,7 @@ #include #include @@ -4376,7 +4303,7 @@ index a5ec77a5ad6f..f9fb4a268b9b 100644 void tcp_fastopen_init_key_once(struct net *net) { -@@ -136,8 +137,6 @@ static bool __tcp_fastopen_cookie_gen_cipher(struct request_sock *req, +@@ -136,8 +137,6 @@ const siphash_key_t *key, struct tcp_fastopen_cookie *foc) { @@ -4385,7 +4312,7 @@ index a5ec77a5ad6f..f9fb4a268b9b 100644 if (req->rsk_ops->family == AF_INET) { const struct iphdr *iph = ip_hdr(syn); -@@ -258,8 +257,9 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk, +@@ -258,8 +257,9 @@ { struct tcp_sock *tp; struct request_sock_queue *queue = &inet_csk(sk)->icsk_accept_queue; @@ -4396,7 +4323,7 @@ index a5ec77a5ad6f..f9fb4a268b9b 100644 child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb, req, NULL, NULL, &own_req); -@@ -294,15 +294,27 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk, +@@ -294,15 +294,27 @@ refcount_set(&req->rsk_refcnt, 2); @@ -4427,10 +4354,9 @@ index a5ec77a5ad6f..f9fb4a268b9b 100644 /* tcp_conn_request() is sending the SYNACK, * and queues the child into listener accept queue. */ -diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index c0fcfa296468..dae2ce9656b8 100644 ---- a/net/ipv4/tcp_input.c -+++ b/net/ipv4/tcp_input.c +diff -aurN linux-5.4.155/net/ipv4/tcp_input.c mptcp-mptcp_v0.96/net/ipv4/tcp_input.c +--- linux-5.4.155/net/ipv4/tcp_input.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/tcp_input.c 2021-10-25 10:05:18.000000000 +0200 @@ -76,35 +76,15 @@ #include #include @@ -4470,7 +4396,7 @@ index c0fcfa296468..dae2ce9656b8 100644 #define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH) #define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH)) -@@ -349,8 +329,12 @@ static void tcp_sndbuf_expand(struct sock *sk) +@@ -349,8 +329,12 @@ per_mss = roundup_pow_of_two(per_mss) + SKB_DATA_ALIGN(sizeof(struct sk_buff)); @@ -4485,7 +4411,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* Fast Recovery (RFC 5681 3.2) : * Cubic needs 1.7 factor, rounded to 2 to include -@@ -359,9 +343,17 @@ static void tcp_sndbuf_expand(struct sock *sk) +@@ -359,9 +343,17 @@ sndmem = ca_ops->sndbuf_expand ? ca_ops->sndbuf_expand(sk) : 2; sndmem *= nr_segs * per_mss; @@ -4504,7 +4430,7 @@ index c0fcfa296468..dae2ce9656b8 100644 } /* 2. Tuning advertised window (window_clamp, rcv_ssthresh) -@@ -410,9 +402,14 @@ static int __tcp_grow_window(const struct sock *sk, const struct sk_buff *skb) +@@ -410,9 +402,14 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) { struct tcp_sock *tp = tcp_sk(sk); @@ -4520,7 +4446,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* Check #1 */ if (room > 0 && !tcp_under_memory_pressure(sk)) { -@@ -422,13 +419,13 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) +@@ -422,13 +419,13 @@ * will fit to rcvbuf in future. */ if (tcp_win_from_space(sk, skb->truesize) <= skb->len) @@ -4537,7 +4463,7 @@ index c0fcfa296468..dae2ce9656b8 100644 inet_csk(sk)->icsk_ack.quick |= 1; } } -@@ -612,7 +609,10 @@ void tcp_rcv_space_adjust(struct sock *sk) +@@ -612,7 +609,10 @@ tcp_mstamp_refresh(tp); time = tcp_stamp_us_delta(tp->tcp_mstamp, tp->rcvq_space.time); @@ -4549,7 +4475,7 @@ index c0fcfa296468..dae2ce9656b8 100644 return; /* Number of bytes copied to user in last RTT */ -@@ -835,7 +835,7 @@ static void tcp_update_pacing_rate(struct sock *sk) +@@ -835,7 +835,7 @@ /* Calculate rto without backoff. This is the second half of Van Jacobson's * routine referred to above. */ @@ -4558,7 +4484,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { const struct tcp_sock *tp = tcp_sk(sk); /* Old crap is replaced with new one. 8) -@@ -1407,6 +1407,13 @@ static struct sk_buff *tcp_shift_skb_data(struct sock *sk, struct sk_buff *skb, +@@ -1407,6 +1407,13 @@ int len; int in_sack; @@ -4572,7 +4498,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* Normally R but no L won't result in plain S */ if (!dup_sack && (TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_RETRANS)) == TCPCB_SACKED_RETRANS) -@@ -2962,7 +2969,7 @@ static bool tcp_ack_update_rtt(struct sock *sk, const int flag, +@@ -2962,7 +2969,7 @@ */ tcp_update_rtt_min(sk, ca_rtt_us, flag); tcp_rtt_estimator(sk, seq_rtt_us); @@ -4581,7 +4507,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* RFC6298: only reset backoff on valid RTT measurement. */ inet_csk(sk)->icsk_backoff = 0; -@@ -3030,7 +3037,7 @@ static void tcp_set_xmit_timer(struct sock *sk) +@@ -3030,7 +3037,7 @@ } /* If we get here, the whole TSO packet has not been acked. */ @@ -4590,7 +4516,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { struct tcp_sock *tp = tcp_sk(sk); u32 packets_acked; -@@ -3050,8 +3057,7 @@ static u32 tcp_tso_acked(struct sock *sk, struct sk_buff *skb) +@@ -3050,8 +3057,7 @@ return packets_acked; } @@ -4600,7 +4526,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { const struct skb_shared_info *shinfo; -@@ -3156,6 +3162,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, u32 prior_fack, +@@ -3156,6 +3162,8 @@ */ if (likely(!(scb->tcp_flags & TCPHDR_SYN))) { flag |= FLAG_DATA_ACKED; @@ -4609,7 +4535,7 @@ index c0fcfa296468..dae2ce9656b8 100644 } else { flag |= FLAG_SYN_ACKED; tp->retrans_stamp = 0; -@@ -3276,7 +3284,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, u32 prior_fack, +@@ -3276,7 +3284,7 @@ return flag; } @@ -4618,7 +4544,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { struct inet_connection_sock *icsk = inet_csk(sk); struct sk_buff *head = tcp_send_head(sk); -@@ -3350,9 +3358,8 @@ static void tcp_cong_control(struct sock *sk, u32 ack, u32 acked_sacked, +@@ -3350,9 +3358,8 @@ /* Check that window update is acceptable. * The function assumes that snd_una<=ack<=snd_next. */ @@ -4630,7 +4556,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { return after(ack, tp->snd_una) || after(ack_seq, tp->snd_wl1) || -@@ -3590,7 +3597,7 @@ static u32 tcp_newly_delivered(struct sock *sk, u32 prior_delivered, int flag) +@@ -3590,7 +3597,7 @@ } /* This routine deals with incoming acks, but not outgoing ones. */ @@ -4639,7 +4565,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); -@@ -3713,6 +3720,16 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) +@@ -3713,6 +3720,16 @@ tcp_rack_update_reo_wnd(sk, &rs); @@ -4656,7 +4582,7 @@ index c0fcfa296468..dae2ce9656b8 100644 if (tp->tlp_high_seq) tcp_process_tlp_ack(sk, ack, flag); -@@ -3856,8 +3873,10 @@ static u16 tcp_parse_mss_option(const struct tcphdr *th, u16 user_mss) +@@ -3856,8 +3873,10 @@ */ void tcp_parse_options(const struct net *net, const struct sk_buff *skb, @@ -4669,7 +4595,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { const unsigned char *ptr; const struct tcphdr *th = tcp_hdr(skb); -@@ -3943,6 +3962,10 @@ void tcp_parse_options(const struct net *net, +@@ -3943,6 +3962,10 @@ */ break; #endif @@ -4680,7 +4606,7 @@ index c0fcfa296468..dae2ce9656b8 100644 case TCPOPT_FASTOPEN: tcp_parse_fastopen_option( opsize - TCPOLEN_FASTOPEN_BASE, -@@ -4010,7 +4033,9 @@ static bool tcp_fast_parse_options(const struct net *net, +@@ -4010,7 +4033,9 @@ return true; } @@ -4691,7 +4617,7 @@ index c0fcfa296468..dae2ce9656b8 100644 if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) tp->rx_opt.rcv_tsecr -= tp->tsoffset; -@@ -4120,7 +4145,7 @@ static inline bool tcp_paws_discard(const struct sock *sk, +@@ -4120,7 +4145,7 @@ static inline bool tcp_sequence(const struct tcp_sock *tp, u32 seq, u32 end_seq) { return !before(end_seq, tp->rcv_wup) && @@ -4700,7 +4626,7 @@ index c0fcfa296468..dae2ce9656b8 100644 } /* When we get a reset we do this. */ -@@ -4169,6 +4194,11 @@ void tcp_fin(struct sock *sk) +@@ -4169,6 +4194,11 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -4712,7 +4638,7 @@ index c0fcfa296468..dae2ce9656b8 100644 inet_csk_schedule_ack(sk); sk->sk_shutdown |= RCV_SHUTDOWN; -@@ -4179,6 +4209,10 @@ void tcp_fin(struct sock *sk) +@@ -4179,6 +4209,10 @@ case TCP_ESTABLISHED: /* Move to CLOSE_WAIT */ tcp_set_state(sk, TCP_CLOSE_WAIT); @@ -4723,7 +4649,7 @@ index c0fcfa296468..dae2ce9656b8 100644 inet_csk_enter_pingpong_mode(sk); break; -@@ -4201,9 +4235,16 @@ void tcp_fin(struct sock *sk) +@@ -4201,9 +4235,16 @@ tcp_set_state(sk, TCP_CLOSING); break; case TCP_FIN_WAIT2: @@ -4741,7 +4667,7 @@ index c0fcfa296468..dae2ce9656b8 100644 break; default: /* Only TCP_LISTEN and TCP_CLOSE are left, in these -@@ -4225,6 +4266,10 @@ void tcp_fin(struct sock *sk) +@@ -4225,6 +4266,10 @@ if (!sock_flag(sk, SOCK_DEAD)) { sk->sk_state_change(sk); @@ -4752,7 +4678,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* Do not send POLL_HUP for half duplex close. */ if (sk->sk_shutdown == SHUTDOWN_MASK || sk->sk_state == TCP_CLOSE) -@@ -4439,6 +4484,9 @@ static bool tcp_try_coalesce(struct sock *sk, +@@ -4439,6 +4484,9 @@ *fragstolen = false; @@ -4762,7 +4688,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* Its possible this segment overlaps with prior segment in queue */ if (TCP_SKB_CB(from)->seq != TCP_SKB_CB(to)->end_seq) return false; -@@ -4493,7 +4541,7 @@ static void tcp_drop(struct sock *sk, struct sk_buff *skb) +@@ -4493,7 +4541,7 @@ /* This one checks to see if we can put data from the * out_of_order queue into the receive_queue. */ @@ -4771,7 +4697,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { struct tcp_sock *tp = tcp_sk(sk); __u32 dsack_high = tp->rcv_nxt; -@@ -4516,7 +4564,14 @@ static void tcp_ofo_queue(struct sock *sk) +@@ -4516,7 +4564,14 @@ p = rb_next(p); rb_erase(&skb->rbnode, &tp->out_of_order_queue); @@ -4787,7 +4713,7 @@ index c0fcfa296468..dae2ce9656b8 100644 tcp_drop(sk, skb); continue; } -@@ -4546,6 +4601,9 @@ static int tcp_prune_queue(struct sock *sk); +@@ -4546,6 +4601,9 @@ static int tcp_try_rmem_schedule(struct sock *sk, struct sk_buff *skb, unsigned int size) { @@ -4797,7 +4723,7 @@ index c0fcfa296468..dae2ce9656b8 100644 if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || !sk_rmem_schedule(sk, skb, size)) { -@@ -4560,7 +4618,7 @@ static int tcp_try_rmem_schedule(struct sock *sk, struct sk_buff *skb, +@@ -4560,7 +4618,7 @@ return 0; } @@ -4806,7 +4732,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { struct tcp_sock *tp = tcp_sk(sk); struct rb_node **p, *parent; -@@ -4632,7 +4690,8 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) +@@ -4632,7 +4690,8 @@ continue; } if (before(seq, TCP_SKB_CB(skb1)->end_seq)) { @@ -4816,7 +4742,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* All the bits are present. Drop. */ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOMERGE); -@@ -4679,6 +4738,11 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) +@@ -4679,6 +4738,11 @@ end_seq); break; } @@ -4828,7 +4754,7 @@ index c0fcfa296468..dae2ce9656b8 100644 rb_erase(&skb1->rbnode, &tp->out_of_order_queue); tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq, TCP_SKB_CB(skb1)->end_seq); -@@ -4690,7 +4754,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) +@@ -4690,7 +4754,7 @@ tp->ooo_last_skb = skb; add_sack: @@ -4837,7 +4763,7 @@ index c0fcfa296468..dae2ce9656b8 100644 tcp_sack_new_ofo_skb(sk, seq, end_seq); end: if (skb) { -@@ -4704,8 +4768,8 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) +@@ -4704,8 +4768,8 @@ } } @@ -4848,7 +4774,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { int eaten; struct sk_buff *tail = skb_peek_tail(&sk->sk_receive_queue); -@@ -4780,7 +4844,8 @@ void tcp_data_ready(struct sock *sk) +@@ -4780,7 +4844,8 @@ if (avail < sk->sk_rcvlowat && !tcp_rmem_pressure(sk) && !sock_flag(sk, SOCK_DONE) && @@ -4858,7 +4784,7 @@ index c0fcfa296468..dae2ce9656b8 100644 return; sk->sk_data_ready(sk); -@@ -4792,10 +4857,14 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) +@@ -4792,10 +4857,14 @@ bool fragstolen; int eaten; @@ -4874,7 +4800,7 @@ index c0fcfa296468..dae2ce9656b8 100644 skb_dst_drop(skb); __skb_pull(skb, tcp_hdr(skb)->doff * 4); -@@ -4806,7 +4875,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) +@@ -4806,7 +4875,7 @@ * Out of sequence packets to the out_of_order_queue. */ if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt) { @@ -4883,7 +4809,7 @@ index c0fcfa296468..dae2ce9656b8 100644 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPZEROWINDOWDROP); goto out_of_window; } -@@ -4822,7 +4891,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) +@@ -4822,7 +4891,7 @@ } eaten = tcp_queue_rcv(sk, skb, &fragstolen); @@ -4892,7 +4818,7 @@ index c0fcfa296468..dae2ce9656b8 100644 tcp_event_data_recv(sk, skb); if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) tcp_fin(sk); -@@ -4844,7 +4913,11 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) +@@ -4844,7 +4913,11 @@ if (eaten > 0) kfree_skb_partial(skb, fragstolen); @@ -4905,7 +4831,7 @@ index c0fcfa296468..dae2ce9656b8 100644 tcp_data_ready(sk); return; } -@@ -4864,7 +4937,8 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) +@@ -4864,7 +4937,8 @@ } /* Out of window. F.e. zero window probe. */ @@ -4915,7 +4841,7 @@ index c0fcfa296468..dae2ce9656b8 100644 goto out_of_window; if (before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { -@@ -4874,7 +4948,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) +@@ -4874,7 +4948,7 @@ /* If window is closed, drop tail of packet. But after * remembering D-SACK for its head made in previous line. */ @@ -4924,7 +4850,7 @@ index c0fcfa296468..dae2ce9656b8 100644 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPZEROWINDOWDROP); goto out_of_window; } -@@ -5187,7 +5261,7 @@ static int tcp_prune_queue(struct sock *sk) +@@ -5187,7 +5261,7 @@ return -1; } @@ -4933,7 +4859,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { const struct tcp_sock *tp = tcp_sk(sk); -@@ -5222,7 +5296,7 @@ static void tcp_new_space(struct sock *sk) +@@ -5222,7 +5296,7 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -4942,7 +4868,7 @@ index c0fcfa296468..dae2ce9656b8 100644 tcp_sndbuf_expand(sk); tp->snd_cwnd_stamp = tcp_jiffies32; } -@@ -5236,10 +5310,11 @@ static void tcp_check_space(struct sock *sk) +@@ -5236,10 +5310,11 @@ sock_reset_flag(sk, SOCK_QUEUE_SHRUNK); /* pairs with tcp_poll() */ smp_mb(); @@ -4957,7 +4883,7 @@ index c0fcfa296468..dae2ce9656b8 100644 tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED); } } -@@ -5258,6 +5333,8 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible) +@@ -5258,6 +5333,8 @@ { struct tcp_sock *tp = tcp_sk(sk); unsigned long rtt, delay; @@ -4966,7 +4892,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* More than one full frame received... */ if (((tp->rcv_nxt - tp->rcv_wup) > inet_csk(sk)->icsk_ack.rcv_mss && -@@ -5266,8 +5343,8 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible) +@@ -5266,8 +5343,8 @@ * If application uses SO_RCVLOWAT, we want send ack now if * we have not received enough bytes to satisfy the condition. */ @@ -4977,7 +4903,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* We ACK each frame or... */ tcp_in_quickack_mode(sk) || /* Protocol state mandates a one-time immediate ACK */ -@@ -5402,6 +5479,10 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *t +@@ -5402,6 +5479,10 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -4988,7 +4914,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* Check if we get a new urgent pointer - normally not. */ if (th->urg) tcp_check_urg(sk, th); -@@ -5544,9 +5625,15 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb, +@@ -5544,9 +5625,15 @@ goto discard; } @@ -5004,7 +4930,7 @@ index c0fcfa296468..dae2ce9656b8 100644 tcp_drop(sk, skb); return false; } -@@ -5603,6 +5690,10 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) +@@ -5603,6 +5690,10 @@ tp->rx_opt.saw_tstamp = 0; @@ -5015,7 +4941,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* pred_flags is 0xS?10 << 16 + snd_wnd * if header_prediction is to be made * 'S' will always be tp->tcp_header_len >> 2 -@@ -5777,7 +5868,7 @@ void tcp_init_transfer(struct sock *sk, int bpf_op) +@@ -5777,7 +5868,7 @@ tcp_call_bpf(sk, bpf_op, 0, NULL); tcp_init_congestion_control(sk); @@ -5024,7 +4950,7 @@ index c0fcfa296468..dae2ce9656b8 100644 } void tcp_finish_connect(struct sock *sk, struct sk_buff *skb) -@@ -5814,17 +5905,24 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, +@@ -5814,17 +5905,24 @@ struct tcp_fastopen_cookie *cookie) { struct tcp_sock *tp = tcp_sk(sk); @@ -5051,7 +4977,7 @@ index c0fcfa296468..dae2ce9656b8 100644 mss = opt.mss_clamp; } -@@ -5848,7 +5946,11 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, +@@ -5848,7 +5946,11 @@ tcp_fastopen_cache_set(sk, mss, cookie, syn_drop, try_exp); @@ -5064,7 +4990,7 @@ index c0fcfa296468..dae2ce9656b8 100644 skb_rbtree_walk_from(data) { if (__tcp_retransmit_skb(sk, data, 1)) break; -@@ -5903,9 +6005,13 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -5903,9 +6005,13 @@ struct tcp_sock *tp = tcp_sk(sk); struct tcp_fastopen_cookie foc = { .len = -1 }; int saved_clamp = tp->rx_opt.mss_clamp; @@ -5079,7 +5005,7 @@ index c0fcfa296468..dae2ce9656b8 100644 if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) tp->rx_opt.rcv_tsecr -= tp->tsoffset; -@@ -5966,11 +6072,41 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -5966,11 +6072,41 @@ tcp_try_undo_spurious_syn(sk); tcp_ack(sk, skb, FLAG_SLOWPATH); @@ -5121,7 +5047,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* RFC1323: The window in SYN & SYN/ACK segments is * never scaled. -@@ -5992,6 +6128,11 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -5992,6 +6128,11 @@ tp->tcp_header_len = sizeof(struct tcphdr); } @@ -5133,7 +5059,7 @@ index c0fcfa296468..dae2ce9656b8 100644 tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); tcp_initialize_rcv_mss(sk); -@@ -6015,9 +6156,12 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -6015,9 +6156,12 @@ } if (fastopen_fail) return -1; @@ -5148,7 +5074,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* Save one ACK. Data will be ready after * several ticks, if write_pending is set. * -@@ -6056,6 +6200,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -6056,6 +6200,7 @@ tcp_paws_reject(&tp->rx_opt, 0)) goto discard_and_undo; @@ -5156,7 +5082,7 @@ index c0fcfa296468..dae2ce9656b8 100644 if (th->syn) { /* We see SYN without ACK. It is attempt of * simultaneous connect with crossed SYNs. -@@ -6072,9 +6217,15 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -6072,9 +6217,15 @@ tp->tcp_header_len = sizeof(struct tcphdr); } @@ -5172,7 +5098,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* RFC1323: The window in SYN & SYN/ACK segments is * never scaled. -@@ -6162,6 +6313,7 @@ static void tcp_rcv_synrecv_state_fastopen(struct sock *sk) +@@ -6162,6 +6313,7 @@ */ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) @@ -5180,7 +5106,7 @@ index c0fcfa296468..dae2ce9656b8 100644 { struct tcp_sock *tp = tcp_sk(sk); struct inet_connection_sock *icsk = inet_csk(sk); -@@ -6204,6 +6356,16 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6204,6 +6356,16 @@ tp->rx_opt.saw_tstamp = 0; tcp_mstamp_refresh(tp); queued = tcp_rcv_synsent_state_process(sk, skb, th); @@ -5197,7 +5123,7 @@ index c0fcfa296468..dae2ce9656b8 100644 if (queued >= 0) return queued; -@@ -6276,6 +6438,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6276,6 +6438,8 @@ if (tp->rx_opt.tstamp_ok) tp->advmss -= TCPOLEN_TSTAMP_ALIGNED; @@ -5206,7 +5132,7 @@ index c0fcfa296468..dae2ce9656b8 100644 if (!inet_csk(sk)->icsk_ca_ops->cong_control) tcp_update_pacing_rate(sk); -@@ -6285,6 +6449,30 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6285,6 +6449,30 @@ tcp_initialize_rcv_mss(sk); tcp_fast_path_on(tp); @@ -5237,7 +5163,7 @@ index c0fcfa296468..dae2ce9656b8 100644 break; case TCP_FIN_WAIT1: { -@@ -6325,7 +6513,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6325,7 +6513,8 @@ tmo = tcp_fin_time(sk); if (tmo > TCP_TIMEWAIT_LEN) { inet_csk_reset_keepalive_timer(sk, tmo - TCP_TIMEWAIT_LEN); @@ -5247,7 +5173,7 @@ index c0fcfa296468..dae2ce9656b8 100644 /* Bad case. We could lose such FIN otherwise. * It is not a big problem, but it looks confusing * and not so rare event. We still can lose it now, -@@ -6334,7 +6523,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6334,7 +6523,7 @@ */ inet_csk_reset_keepalive_timer(sk, tmo); } else { @@ -5256,7 +5182,7 @@ index c0fcfa296468..dae2ce9656b8 100644 goto discard; } break; -@@ -6342,7 +6531,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6342,7 +6531,7 @@ case TCP_CLOSING: if (tp->snd_una == tp->write_seq) { @@ -5265,7 +5191,7 @@ index c0fcfa296468..dae2ce9656b8 100644 goto discard; } break; -@@ -6354,6 +6543,9 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6354,6 +6543,9 @@ goto discard; } break; @@ -5275,7 +5201,7 @@ index c0fcfa296468..dae2ce9656b8 100644 } /* step 6: check the URG bit */ -@@ -6375,7 +6567,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6375,7 +6567,8 @@ */ if (sk->sk_shutdown & RCV_SHUTDOWN) { if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && @@ -5285,7 +5211,7 @@ index c0fcfa296468..dae2ce9656b8 100644 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONDATA); tcp_reset(sk); return 1; -@@ -6477,6 +6670,8 @@ static void tcp_openreq_init(struct request_sock *req, +@@ -6477,6 +6670,8 @@ ireq->wscale_ok = rx_opt->wscale_ok; ireq->acked = 0; ireq->ecn_ok = 0; @@ -5294,7 +5220,7 @@ index c0fcfa296468..dae2ce9656b8 100644 ireq->ir_rmt_port = tcp_hdr(skb)->source; ireq->ir_num = ntohs(tcp_hdr(skb)->dest); ireq->ir_mark = inet_request_mark(sk, skb); -@@ -6602,12 +6797,17 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6602,12 +6797,17 @@ /* TW buckets are converted to open requests without * limitations, they conserve resources and peer is * evidently real one. @@ -5313,7 +5239,7 @@ index c0fcfa296468..dae2ce9656b8 100644 } if (sk_acceptq_is_full(sk)) { -@@ -6625,8 +6825,8 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6625,8 +6825,8 @@ tcp_clear_options(&tmp_opt); tmp_opt.mss_clamp = af_ops->mss_clamp; tmp_opt.user_mss = tp->rx_opt.user_mss; @@ -5324,7 +5250,7 @@ index c0fcfa296468..dae2ce9656b8 100644 if (want_cookie && !tmp_opt.saw_tstamp) tcp_clear_options(&tmp_opt); -@@ -6641,7 +6841,8 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6641,7 +6841,8 @@ /* Note: tcp_v6_init_req() might override ir_iif for link locals */ inet_rsk(req)->ir_iif = inet_request_bound_dev_if(sk, skb); @@ -5334,7 +5260,7 @@ index c0fcfa296468..dae2ce9656b8 100644 if (security_inet_conn_request(sk, skb, req)) goto drop_and_free; -@@ -6677,7 +6878,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6677,7 +6878,7 @@ tcp_ecn_create_request(req, skb, sk, dst); if (want_cookie) { @@ -5343,7 +5269,7 @@ index c0fcfa296468..dae2ce9656b8 100644 req->cookie_ts = tmp_opt.tstamp_ok; if (!tmp_opt.tstamp_ok) inet_rsk(req)->ecn_ok = 0; -@@ -6692,17 +6893,25 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6692,17 +6893,25 @@ fastopen_sk = tcp_try_fastopen(sk, skb, req, &foc, dst); } if (fastopen_sk) { @@ -5370,10 +5296,9 @@ index c0fcfa296468..dae2ce9656b8 100644 sock_put(fastopen_sk); } else { tcp_rsk(req)->tfo_listener = false; -diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c -index 2ce85e52aea7..2e76c006ad16 100644 ---- a/net/ipv4/tcp_ipv4.c -+++ b/net/ipv4/tcp_ipv4.c +diff -aurN linux-5.4.155/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.96/net/ipv4/tcp_ipv4.c +--- linux-5.4.155/net/ipv4/tcp_ipv4.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/tcp_ipv4.c 2021-10-25 10:05:18.000000000 +0200 @@ -62,6 +62,8 @@ #include #include @@ -5383,7 +5308,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 #include #include #include -@@ -209,6 +211,8 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) +@@ -209,6 +211,8 @@ struct ip_options_rcu *inet_opt; struct inet_timewait_death_row *tcp_death_row = &sock_net(sk)->ipv4.tcp_death_row; @@ -5392,7 +5317,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 if (addr_len < sizeof(struct sockaddr_in)) return -EINVAL; -@@ -430,7 +434,7 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -430,7 +434,7 @@ struct inet_sock *inet; const int type = icmp_hdr(icmp_skb)->type; const int code = icmp_hdr(icmp_skb)->code; @@ -5401,7 +5326,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 struct sk_buff *skb; struct request_sock *fastopen; u32 seq, snd_una; -@@ -460,13 +464,19 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -460,13 +464,19 @@ return 0; } @@ -5423,7 +5348,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)) __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS); } -@@ -479,7 +489,6 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -479,7 +489,6 @@ } icsk = inet_csk(sk); @@ -5431,10 +5356,10 @@ index 2ce85e52aea7..2e76c006ad16 100644 /* XXX (TFO) - tp->snd_una should be ISN (tcp_create_openreq_child() */ fastopen = rcu_dereference(tp->fastopen_rsk); snd_una = fastopen ? tcp_rsk(fastopen)->snt_isn : tp->snd_una; -@@ -513,11 +522,13 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -513,11 +522,13 @@ goto out; - WRITE_ONCE(tp->mtu_info, info); + tp->mtu_info = info; - if (!sock_owned_by_user(sk)) { + if (!sock_owned_by_user(meta_sk)) { tcp_v4_mtu_reduced(sk); @@ -5446,7 +5371,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 } goto out; } -@@ -531,7 +542,7 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -531,7 +542,7 @@ !icsk->icsk_backoff || fastopen) break; @@ -5455,7 +5380,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 break; skb = tcp_rtx_queue_head(sk); -@@ -555,7 +566,7 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -555,7 +566,7 @@ } else { /* RTO revert clocked out retransmission. * Will retransmit now */ @@ -5464,7 +5389,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 } break; -@@ -575,7 +586,7 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -575,7 +586,7 @@ if (fastopen && !fastopen->sk) break; @@ -5473,7 +5398,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 sk->sk_err = err; sk->sk_error_report(sk); -@@ -604,7 +615,7 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -604,7 +615,7 @@ */ inet = inet_sk(sk); @@ -5482,7 +5407,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 sk->sk_err = err; sk->sk_error_report(sk); } else { /* Only an error on timeout */ -@@ -612,7 +623,7 @@ int tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -612,7 +623,7 @@ } out: @@ -5491,7 +5416,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 sock_put(sk); return 0; } -@@ -648,7 +659,7 @@ EXPORT_SYMBOL(tcp_v4_send_check); +@@ -648,7 +659,7 @@ * Exception: precedence violation. We do not implement it in any case. */ @@ -5500,7 +5425,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 { const struct tcphdr *th = tcp_hdr(skb); struct { -@@ -800,10 +811,10 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) +@@ -800,10 +811,10 @@ */ static void tcp_v4_send_ack(const struct sock *sk, @@ -5513,18 +5438,18 @@ index 2ce85e52aea7..2e76c006ad16 100644 { const struct tcphdr *th = tcp_hdr(skb); struct { -@@ -811,6 +822,10 @@ static void tcp_v4_send_ack(const struct sock *sk, - __be32 opt[(TCPOLEN_TSTAMP_ALIGNED >> 2) +@@ -812,6 +823,10 @@ #ifdef CONFIG_TCP_MD5SIG + (TCPOLEN_MD5SIG_ALIGNED >> 2) -+#endif + #endif +#ifdef CONFIG_MPTCP + + ((MPTCP_SUB_LEN_DSS >> 2) + + (MPTCP_SUB_LEN_ACK >> 2)) - #endif ++#endif ]; } rep; -@@ -858,6 +873,21 @@ static void tcp_v4_send_ack(const struct sock *sk, + struct net *net = sock_net(sk); +@@ -858,6 +873,21 @@ ip_hdr(skb)->daddr, &rep.th); } #endif @@ -5546,7 +5471,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 arg.flags = reply_flags; arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr, ip_hdr(skb)->saddr, /* XXX */ -@@ -889,28 +919,36 @@ static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) +@@ -889,28 +919,36 @@ { struct inet_timewait_sock *tw = inet_twsk(sk); struct tcp_timewait_sock *tcptw = tcp_twsk(sk); @@ -5588,7 +5513,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 tcp_sk(sk)->snd_nxt; /* RFC 7323 2.3 -@@ -919,7 +957,7 @@ static void tcp_v4_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, +@@ -919,7 +957,7 @@ * Rcv.Wind.Shift bits: */ tcp_v4_send_ack(sk, skb, seq, @@ -5597,7 +5522,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 req->rsk_rcv_wnd >> inet_rsk(req)->rcv_wscale, tcp_time_stamp_raw() + tcp_rsk(req)->ts_off, req->ts_recent, -@@ -927,7 +965,7 @@ static void tcp_v4_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, +@@ -927,7 +965,7 @@ tcp_md5_do_lookup(sk, (union tcp_md5_addr *)&ip_hdr(skb)->saddr, AF_INET), inet_rsk(req)->no_srccheck ? IP_REPLY_ARG_NOSRCCHECK : 0, @@ -5606,7 +5531,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 } /* -@@ -935,11 +973,11 @@ static void tcp_v4_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, +@@ -935,11 +973,11 @@ * This still operates on a request_sock only, not on a big * socket. */ @@ -5623,7 +5548,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 { const struct inet_request_sock *ireq = inet_rsk(req); struct flowi4 fl4; -@@ -969,7 +1007,7 @@ static int tcp_v4_send_synack(const struct sock *sk, struct dst_entry *dst, +@@ -969,7 +1007,7 @@ /* * IPv4 request_sock destructor. */ @@ -5632,7 +5557,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 { kfree(rcu_dereference_protected(inet_rsk(req)->ireq_opt, 1)); } -@@ -1354,9 +1392,10 @@ static bool tcp_v4_inbound_md5_hash(const struct sock *sk, +@@ -1354,9 +1392,10 @@ return false; } @@ -5646,7 +5571,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 { struct inet_request_sock *ireq = inet_rsk(req); struct net *net = sock_net(sk_listener); -@@ -1364,6 +1403,8 @@ static void tcp_v4_init_req(struct request_sock *req, +@@ -1364,6 +1403,8 @@ sk_rcv_saddr_set(req_to_sk(req), ip_hdr(skb)->daddr); sk_daddr_set(req_to_sk(req), ip_hdr(skb)->saddr); RCU_INIT_POINTER(ireq->ireq_opt, tcp_v4_save_options(net, skb)); @@ -5655,7 +5580,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 } static struct dst_entry *tcp_v4_route_req(const struct sock *sk, -@@ -1383,7 +1424,7 @@ struct request_sock_ops tcp_request_sock_ops __read_mostly = { +@@ -1383,7 +1424,7 @@ .syn_ack_timeout = tcp_syn_ack_timeout, }; @@ -5664,7 +5589,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 .mss_clamp = TCP_MSS_DEFAULT, #ifdef CONFIG_TCP_MD5SIG .req_md5_lookup = tcp_v4_md5_lookup, -@@ -1520,7 +1561,7 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb, +@@ -1520,7 +1561,7 @@ } EXPORT_SYMBOL(tcp_v4_syn_recv_sock); @@ -5673,7 +5598,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 { #ifdef CONFIG_SYN_COOKIES const struct tcphdr *th = tcp_hdr(skb); -@@ -1558,6 +1599,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) +@@ -1558,6 +1599,9 @@ { struct sock *rsk; @@ -5683,7 +5608,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ struct dst_entry *dst = sk->sk_rx_dst; -@@ -1803,6 +1847,10 @@ static void tcp_v4_fill_cb(struct sk_buff *skb, const struct iphdr *iph, +@@ -1803,6 +1847,10 @@ TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + skb->len - th->doff * 4); TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); @@ -5694,7 +5619,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th); TCP_SKB_CB(skb)->tcp_tw_isn = 0; TCP_SKB_CB(skb)->ip_dsfield = ipv4_get_dsfield(iph); -@@ -1822,8 +1870,8 @@ int tcp_v4_rcv(struct sk_buff *skb) +@@ -1822,8 +1870,8 @@ int sdif = inet_sdif(skb); const struct iphdr *iph; const struct tcphdr *th; @@ -5704,7 +5629,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 int ret; if (skb->pkt_type != PACKET_HOST) -@@ -1877,7 +1925,11 @@ int tcp_v4_rcv(struct sk_buff *skb) +@@ -1877,7 +1925,11 @@ reqsk_put(req); goto csum_error; } @@ -5717,7 +5642,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 inet_csk_reqsk_queue_drop_and_put(sk, req); goto lookup; } -@@ -1886,6 +1938,7 @@ int tcp_v4_rcv(struct sk_buff *skb) +@@ -1886,6 +1938,7 @@ */ sock_hold(sk); refcounted = true; @@ -5725,7 +5650,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; -@@ -1946,19 +1999,28 @@ int tcp_v4_rcv(struct sk_buff *skb) +@@ -1946,19 +1999,28 @@ sk_incoming_cpu_update(sk); @@ -5758,7 +5683,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 if (skb_to_free) __kfree_skb(skb_to_free); -@@ -1974,6 +2036,19 @@ int tcp_v4_rcv(struct sk_buff *skb) +@@ -1974,6 +2036,19 @@ tcp_v4_fill_cb(skb, iph, th); @@ -5778,7 +5703,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 if (tcp_checksum_complete(skb)) { csum_error: __TCP_INC_STATS(net, TCP_MIB_CSUMERRORS); -@@ -2022,6 +2097,18 @@ int tcp_v4_rcv(struct sk_buff *skb) +@@ -2022,6 +2097,18 @@ refcounted = false; goto process; } @@ -5797,7 +5722,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 } /* to ACK */ /* fall through */ -@@ -2091,7 +2178,12 @@ static int tcp_v4_init_sock(struct sock *sk) +@@ -2091,7 +2178,12 @@ tcp_init_sock(sk); @@ -5811,7 +5736,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 #ifdef CONFIG_TCP_MD5SIG tcp_sk(sk)->af_specific = &tcp_sock_ipv4_specific; -@@ -2110,6 +2202,11 @@ void tcp_v4_destroy_sock(struct sock *sk) +@@ -2110,6 +2202,11 @@ tcp_cleanup_congestion_control(sk); @@ -5823,7 +5748,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 tcp_cleanup_ulp(sk); /* Cleanup up the write buffer. */ -@@ -2615,6 +2712,11 @@ struct proto tcp_prot = { +@@ -2615,6 +2712,11 @@ .sysctl_rmem_offset = offsetof(struct net, ipv4.sysctl_tcp_rmem), .max_header = MAX_TCP_HEADER, .obj_size = sizeof(struct tcp_sock), @@ -5835,7 +5760,7 @@ index 2ce85e52aea7..2e76c006ad16 100644 .slab_flags = SLAB_TYPESAFE_BY_RCU, .twsk_prot = &tcp_timewait_sock_ops, .rsk_prot = &tcp_request_sock_ops, -@@ -2625,6 +2727,9 @@ struct proto tcp_prot = { +@@ -2625,6 +2727,9 @@ .compat_getsockopt = compat_tcp_getsockopt, #endif .diag_destroy = tcp_abort, @@ -5845,10 +5770,9 @@ index 2ce85e52aea7..2e76c006ad16 100644 }; EXPORT_SYMBOL(tcp_prot); -diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c -index 194743bd3fc1..b35942faf7df 100644 ---- a/net/ipv4/tcp_minisocks.c -+++ b/net/ipv4/tcp_minisocks.c +diff -aurN linux-5.4.155/net/ipv4/tcp_minisocks.c mptcp-mptcp_v0.96/net/ipv4/tcp_minisocks.c +--- linux-5.4.155/net/ipv4/tcp_minisocks.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/tcp_minisocks.c 2021-10-25 10:05:18.000000000 +0200 @@ -19,11 +19,13 @@ * Jorge Cwik, */ @@ -5863,7 +5787,7 @@ index 194743bd3fc1..b35942faf7df 100644 #include #include #include -@@ -95,10 +97,14 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, +@@ -95,10 +97,14 @@ struct tcp_options_received tmp_opt; struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); bool paws_reject = false; @@ -5880,7 +5804,7 @@ index 194743bd3fc1..b35942faf7df 100644 if (tmp_opt.saw_tstamp) { if (tmp_opt.rcv_tsecr) -@@ -107,6 +113,11 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, +@@ -107,6 +113,11 @@ tmp_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp; paws_reject = tcp_paws_reject(&tmp_opt, th->rst); } @@ -5892,7 +5816,7 @@ index 194743bd3fc1..b35942faf7df 100644 } if (tw->tw_substate == TCP_FIN_WAIT2) { -@@ -130,6 +141,16 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, +@@ -130,6 +141,16 @@ if (!th->ack || !after(TCP_SKB_CB(skb)->end_seq, tcptw->tw_rcv_nxt) || TCP_SKB_CB(skb)->end_seq == TCP_SKB_CB(skb)->seq) { @@ -5909,7 +5833,7 @@ index 194743bd3fc1..b35942faf7df 100644 inet_twsk_put(tw); return TCP_TW_SUCCESS; } -@@ -270,11 +291,25 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) +@@ -270,11 +291,25 @@ tw->tw_rcv_wscale = tp->rx_opt.rcv_wscale; tcptw->tw_rcv_nxt = tp->rcv_nxt; tcptw->tw_snd_nxt = tp->snd_nxt; @@ -5936,7 +5860,7 @@ index 194743bd3fc1..b35942faf7df 100644 tcptw->tw_tx_delay = tp->tcp_tx_delay; #if IS_ENABLED(CONFIG_IPV6) if (tw->tw_family == PF_INET6) { -@@ -336,6 +371,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) +@@ -336,6 +371,7 @@ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW); } @@ -5944,7 +5868,7 @@ index 194743bd3fc1..b35942faf7df 100644 tcp_update_metrics(sk); tcp_done(sk); } -@@ -343,6 +379,10 @@ EXPORT_SYMBOL(tcp_time_wait); +@@ -343,6 +379,10 @@ void tcp_twsk_destructor(struct sock *sk) { @@ -5955,7 +5879,7 @@ index 194743bd3fc1..b35942faf7df 100644 #ifdef CONFIG_TCP_MD5SIG if (static_branch_unlikely(&tcp_md5_needed)) { struct tcp_timewait_sock *twsk = tcp_twsk(sk); -@@ -386,8 +426,9 @@ void tcp_openreq_init_rwin(struct request_sock *req, +@@ -386,8 +426,9 @@ full_space = rcv_wnd * mss; /* tcp_full_space because it is guaranteed to be the first packet */ @@ -5967,7 +5891,7 @@ index 194743bd3fc1..b35942faf7df 100644 &req->rsk_rcv_wnd, &req->rsk_window_clamp, ireq->wscale_ok, -@@ -487,6 +528,8 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, +@@ -487,6 +528,8 @@ WRITE_ONCE(newtp->snd_nxt, seq); newtp->snd_up = seq; @@ -5976,7 +5900,7 @@ index 194743bd3fc1..b35942faf7df 100644 INIT_LIST_HEAD(&newtp->tsq_node); INIT_LIST_HEAD(&newtp->tsorted_sent_queue); -@@ -511,6 +554,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, +@@ -511,6 +554,7 @@ newtp->window_clamp = req->rsk_window_clamp; newtp->rcv_ssthresh = req->rsk_rcv_wnd; newtp->rcv_wnd = req->rsk_rcv_wnd; @@ -5984,7 +5908,7 @@ index 194743bd3fc1..b35942faf7df 100644 newtp->rx_opt.wscale_ok = ireq->wscale_ok; if (newtp->rx_opt.wscale_ok) { newtp->rx_opt.snd_wscale = ireq->snd_wscale; -@@ -530,6 +574,8 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, +@@ -530,6 +574,8 @@ newtp->rx_opt.ts_recent_stamp = 0; newtp->tcp_header_len = sizeof(struct tcphdr); } @@ -5993,7 +5917,7 @@ index 194743bd3fc1..b35942faf7df 100644 if (req->num_timeout) { newtp->undo_marker = treq->snt_isn; newtp->retrans_stamp = div_u64(treq->snt_synack, -@@ -547,6 +593,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, +@@ -547,6 +593,7 @@ tcp_ecn_openreq_child(newtp, req); newtp->fastopen_req = NULL; RCU_INIT_POINTER(newtp->fastopen_rsk, NULL); @@ -6001,7 +5925,7 @@ index 194743bd3fc1..b35942faf7df 100644 __TCP_INC_STATS(sock_net(sk), TCP_MIB_PASSIVEOPENS); -@@ -570,15 +617,20 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, +@@ -570,15 +617,20 @@ bool fastopen, bool *req_stolen) { struct tcp_options_received tmp_opt; @@ -6023,7 +5947,7 @@ index 194743bd3fc1..b35942faf7df 100644 if (tmp_opt.saw_tstamp) { tmp_opt.ts_recent = req->ts_recent; -@@ -619,7 +671,14 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, +@@ -619,7 +671,14 @@ * * Reset timer after retransmitting SYNACK, similar to * the idea of fast retransmit in recovery. @@ -6038,7 +5962,7 @@ index 194743bd3fc1..b35942faf7df 100644 if (!tcp_oow_rate_limited(sock_net(sk), skb, LINUX_MIB_TCPACKSKIPPEDSYNRECV, &tcp_rsk(req)->last_oow_ack_time) && -@@ -767,17 +826,40 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, +@@ -767,17 +826,40 @@ * ESTABLISHED STATE. If it will be dropped after * socket is created, wait for troubles. */ @@ -6079,7 +6003,7 @@ index 194743bd3fc1..b35942faf7df 100644 if (!sock_net(sk)->ipv4.sysctl_tcp_abort_on_overflow) { inet_rsk(req)->acked = 1; return NULL; -@@ -823,12 +905,13 @@ int tcp_child_process(struct sock *parent, struct sock *child, +@@ -823,12 +905,13 @@ { int ret = 0; int state = child->sk_state; @@ -6094,7 +6018,7 @@ index 194743bd3fc1..b35942faf7df 100644 ret = tcp_rcv_state_process(child, skb); /* Wakeup parent, send SIGIO */ if (state == TCP_SYN_RECV && child->sk_state != state) -@@ -838,10 +921,14 @@ int tcp_child_process(struct sock *parent, struct sock *child, +@@ -838,10 +921,14 @@ * in main socket hash table and lock on listening * socket does not protect us more. */ @@ -6110,10 +6034,9 @@ index 194743bd3fc1..b35942faf7df 100644 sock_put(child); return ret; } -diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c -index 638d7b49ad71..d246e537e686 100644 ---- a/net/ipv4/tcp_output.c -+++ b/net/ipv4/tcp_output.c +diff -aurN linux-5.4.155/net/ipv4/tcp_output.c mptcp-mptcp_v0.96/net/ipv4/tcp_output.c +--- linux-5.4.155/net/ipv4/tcp_output.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/tcp_output.c 2021-10-25 10:05:18.000000000 +0200 @@ -37,6 +37,12 @@ #define pr_fmt(fmt) "TCP: " fmt @@ -6127,7 +6050,7 @@ index 638d7b49ad71..d246e537e686 100644 #include #include -@@ -57,11 +63,8 @@ void tcp_mstamp_refresh(struct tcp_sock *tp) +@@ -57,11 +63,8 @@ tp->tcp_mstamp = div_u64(val, NSEC_PER_USEC); } @@ -6140,7 +6063,7 @@ index 638d7b49ad71..d246e537e686 100644 { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); -@@ -255,12 +258,16 @@ EXPORT_SYMBOL(tcp_select_initial_window); +@@ -255,12 +258,16 @@ * value can be stuffed directly into th->window for an outgoing * frame. */ @@ -6160,7 +6083,7 @@ index 638d7b49ad71..d246e537e686 100644 /* Never shrink the offered window */ if (new_win < cur_win) { -@@ -276,8 +283,10 @@ static u16 tcp_select_window(struct sock *sk) +@@ -276,8 +283,10 @@ LINUX_MIB_TCPWANTZEROWINDOWADV); new_win = ALIGN(cur_win, 1 << tp->rx_opt.rcv_wscale); } @@ -6171,7 +6094,7 @@ index 638d7b49ad71..d246e537e686 100644 /* Make sure we do not exceed the maximum possible * scaled window. -@@ -388,7 +397,7 @@ static void tcp_ecn_send(struct sock *sk, struct sk_buff *skb, +@@ -388,7 +397,7 @@ /* Constructs common control bits of non-data skb. If SYN/FIN is present, * auto increment end seqno. */ @@ -6180,7 +6103,7 @@ index 638d7b49ad71..d246e537e686 100644 { skb->ip_summed = CHECKSUM_PARTIAL; -@@ -403,7 +412,7 @@ static void tcp_init_nondata_skb(struct sk_buff *skb, u32 seq, u8 flags) +@@ -403,7 +412,7 @@ TCP_SKB_CB(skb)->end_seq = seq; } @@ -6189,7 +6112,7 @@ index 638d7b49ad71..d246e537e686 100644 { return tp->snd_una != tp->snd_up; } -@@ -414,6 +423,7 @@ static inline bool tcp_urg_mode(const struct tcp_sock *tp) +@@ -414,6 +423,7 @@ #define OPTION_WSCALE (1 << 3) #define OPTION_FAST_OPEN_COOKIE (1 << 8) #define OPTION_SMC (1 << 9) @@ -6197,7 +6120,7 @@ index 638d7b49ad71..d246e537e686 100644 static void smc_options_write(__be32 *ptr, u16 *options) { -@@ -430,17 +440,6 @@ static void smc_options_write(__be32 *ptr, u16 *options) +@@ -430,17 +440,6 @@ #endif } @@ -6215,7 +6138,7 @@ index 638d7b49ad71..d246e537e686 100644 /* Write previously computed TCP options to the packet. * * Beware: Something in the Internet is very sensitive to the ordering of -@@ -455,7 +454,7 @@ struct tcp_out_options { +@@ -455,7 +454,7 @@ * (but it may well be that other scenarios fail similarly). */ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, @@ -6224,7 +6147,7 @@ index 638d7b49ad71..d246e537e686 100644 { u16 options = opts->options; /* mungable copy */ -@@ -549,6 +548,9 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, +@@ -549,6 +548,9 @@ } smc_options_write(ptr, &options); @@ -6234,7 +6157,7 @@ index 638d7b49ad71..d246e537e686 100644 } static void smc_set_option(const struct tcp_sock *tp, -@@ -635,6 +637,8 @@ static unsigned int tcp_syn_options(struct sock *sk, struct sk_buff *skb, +@@ -635,6 +637,8 @@ if (unlikely(!(OPTION_TS & opts->options))) remaining -= TCPOLEN_SACKPERM_ALIGNED; } @@ -6243,7 +6166,7 @@ index 638d7b49ad71..d246e537e686 100644 if (fastopen && fastopen->cookie.len >= 0) { u32 need = fastopen->cookie.len; -@@ -718,6 +722,9 @@ static unsigned int tcp_synack_options(const struct sock *sk, +@@ -718,6 +722,9 @@ smc_set_option_cond(tcp_sk(sk), ireq, opts, &remaining); @@ -6253,7 +6176,7 @@ index 638d7b49ad71..d246e537e686 100644 return MAX_TCP_OPTION_SPACE - remaining; } -@@ -752,14 +759,19 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb +@@ -752,14 +759,19 @@ opts->tsecr = tp->rx_opt.ts_recent; size += TCPOLEN_TSTAMP_ALIGNED; } @@ -6278,7 +6201,7 @@ index 638d7b49ad71..d246e537e686 100644 if (likely(opts->num_sack_blocks)) size += TCPOLEN_SACK_BASE_ALIGNED + opts->num_sack_blocks * TCPOLEN_SACK_PERBLOCK; -@@ -802,19 +814,31 @@ static void tcp_tsq_write(struct sock *sk) +@@ -802,19 +814,31 @@ tcp_xmit_retransmit_queue(sk); } @@ -6317,7 +6240,7 @@ index 638d7b49ad71..d246e537e686 100644 } /* * One tasklet per cpu tries to send more skbs. -@@ -851,7 +875,9 @@ static void tcp_tasklet_func(unsigned long data) +@@ -851,7 +875,9 @@ #define TCP_DEFERRED_ALL (TCPF_TSQ_DEFERRED | \ TCPF_WRITE_TIMER_DEFERRED | \ TCPF_DELACK_TIMER_DEFERRED | \ @@ -6328,7 +6251,7 @@ index 638d7b49ad71..d246e537e686 100644 /** * tcp_release_cb - tcp release_sock() callback * @sk: socket -@@ -874,6 +900,9 @@ void tcp_release_cb(struct sock *sk) +@@ -874,6 +900,9 @@ if (flags & TCPF_TSQ_DEFERRED) { tcp_tsq_write(sk); __sock_put(sk); @@ -6338,7 +6261,7 @@ index 638d7b49ad71..d246e537e686 100644 } /* Here begins the tricky part : * We are called from release_sock() with : -@@ -898,6 +927,13 @@ void tcp_release_cb(struct sock *sk) +@@ -898,6 +927,13 @@ inet_csk(sk)->icsk_af_ops->mtu_reduced(sk); __sock_put(sk); } @@ -6352,7 +6275,7 @@ index 638d7b49ad71..d246e537e686 100644 } EXPORT_SYMBOL(tcp_release_cb); -@@ -981,8 +1017,8 @@ enum hrtimer_restart tcp_pace_kick(struct hrtimer *timer) +@@ -981,8 +1017,8 @@ return HRTIMER_NORESTART; } @@ -6363,7 +6286,7 @@ index 638d7b49ad71..d246e537e686 100644 { struct tcp_sock *tp = tcp_sk(sk); -@@ -1128,10 +1164,10 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, +@@ -1128,10 +1164,10 @@ } } @@ -6376,7 +6299,7 @@ index 638d7b49ad71..d246e537e686 100644 tcp_ecn_send(sk, skb, th, tcp_header_size); } else { /* RFC1323: The window in SYN & SYN/ACK segments -@@ -1189,8 +1225,8 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, +@@ -1189,8 +1225,8 @@ return err; } @@ -6387,7 +6310,7 @@ index 638d7b49ad71..d246e537e686 100644 { return __tcp_transmit_skb(sk, skb, clone_it, gfp_mask, tcp_sk(sk)->rcv_nxt); -@@ -1201,7 +1237,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, +@@ -1201,7 +1237,7 @@ * NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames, * otherwise socket can stall. */ @@ -6396,7 +6319,7 @@ index 638d7b49ad71..d246e537e686 100644 { struct tcp_sock *tp = tcp_sk(sk); -@@ -1214,7 +1250,7 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) +@@ -1214,7 +1250,7 @@ } /* Initialize TSO segments for a packet. */ @@ -6405,7 +6328,7 @@ index 638d7b49ad71..d246e537e686 100644 { if (skb->len <= mss_now) { /* Avoid the costly divide in the normal -@@ -1231,7 +1267,7 @@ static void tcp_set_skb_tso_segs(struct sk_buff *skb, unsigned int mss_now) +@@ -1231,7 +1267,7 @@ /* Pcount in the middle of the write queue got changed, we need to do various * tweaks to fix counters */ @@ -6414,7 +6337,7 @@ index 638d7b49ad71..d246e537e686 100644 { struct tcp_sock *tp = tcp_sk(sk); -@@ -1400,7 +1436,7 @@ int tcp_fragment(struct sock *sk, enum tcp_queue tcp_queue, +@@ -1400,7 +1436,7 @@ /* This is similar to __pskb_pull_tail(). The difference is that pulled * data is not copied, but immediately discarded. */ @@ -6423,7 +6346,7 @@ index 638d7b49ad71..d246e537e686 100644 { struct skb_shared_info *shinfo; int i, k, eat; -@@ -1623,6 +1659,7 @@ unsigned int tcp_current_mss(struct sock *sk) +@@ -1623,6 +1659,7 @@ return mss_now; } @@ -6431,7 +6354,7 @@ index 638d7b49ad71..d246e537e686 100644 /* RFC2861, slow part. Adjust cwnd, after it was not full during one rto. * As additional protections, we do not touch cwnd in retransmission phases, -@@ -1682,8 +1719,11 @@ static void tcp_cwnd_validate(struct sock *sk, bool is_cwnd_limited) +@@ -1682,8 +1719,11 @@ * 2) not cwnd limited (this else condition) * 3) no more data to send (tcp_write_queue_empty()) * 4) application is hitting buffer limit (SOCK_NOSPACE) @@ -6443,7 +6366,7 @@ index 638d7b49ad71..d246e537e686 100644 test_bit(SOCK_NOSPACE, &sk->sk_socket->flags) && (1 << sk->sk_state) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) tcp_chrono_start(sk, TCP_CHRONO_SNDBUF_LIMITED); -@@ -1705,8 +1745,8 @@ static bool tcp_minshall_check(const struct tcp_sock *tp) +@@ -1705,8 +1745,8 @@ * But we can avoid doing the divide again given we already have * skb_pcount = skb->len / mss_now */ @@ -6454,7 +6377,7 @@ index 638d7b49ad71..d246e537e686 100644 { if (skb->len < tcp_skb_pcount(skb) * mss_now) tp->snd_sml = TCP_SKB_CB(skb)->end_seq; -@@ -1752,7 +1792,7 @@ static u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now, +@@ -1752,7 +1792,7 @@ /* Return the number of segments we want in the skb we are transmitting. * See if congestion control module wants to decide; otherwise, autosize. */ @@ -6463,7 +6386,7 @@ index 638d7b49ad71..d246e537e686 100644 { const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; u32 min_tso, tso_segs; -@@ -1766,11 +1806,11 @@ static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now) +@@ -1766,11 +1806,11 @@ } /* Returns the portion of skb which can be sent right away */ @@ -6480,7 +6403,7 @@ index 638d7b49ad71..d246e537e686 100644 { const struct tcp_sock *tp = tcp_sk(sk); u32 partial, needed, window, max_len; -@@ -1800,13 +1840,14 @@ static unsigned int tcp_mss_split_point(const struct sock *sk, +@@ -1800,13 +1840,14 @@ /* Can at least one segment of SKB be sent right now, according to the * congestion window rules? If so, return how many segments are allowed. */ @@ -6498,7 +6421,7 @@ index 638d7b49ad71..d246e537e686 100644 tcp_skb_pcount(skb) == 1) return 1; -@@ -1821,12 +1862,13 @@ static inline unsigned int tcp_cwnd_test(const struct tcp_sock *tp, +@@ -1821,12 +1862,13 @@ halfcwnd = max(cwnd >> 1, 1U); return min(halfcwnd, cwnd - in_flight); } @@ -6513,7 +6436,7 @@ index 638d7b49ad71..d246e537e686 100644 { int tso_segs = tcp_skb_pcount(skb); -@@ -1841,8 +1883,8 @@ static int tcp_init_tso_segs(struct sk_buff *skb, unsigned int mss_now) +@@ -1841,8 +1883,8 @@ /* Return true if the Nagle test allows this packet to be * sent now. */ @@ -6524,7 +6447,7 @@ index 638d7b49ad71..d246e537e686 100644 { /* Nagle rule does not apply to frames, which sit in the middle of the * write_queue (they have no chances to get new data). -@@ -1854,7 +1896,8 @@ static inline bool tcp_nagle_test(const struct tcp_sock *tp, const struct sk_buf +@@ -1854,7 +1896,8 @@ return true; /* Don't use the nagle rule for urgent data (or for the final FIN). */ @@ -6534,7 +6457,7 @@ index 638d7b49ad71..d246e537e686 100644 return true; if (!tcp_nagle_check(skb->len < cur_mss, tp, nonagle)) -@@ -1864,9 +1907,8 @@ static inline bool tcp_nagle_test(const struct tcp_sock *tp, const struct sk_buf +@@ -1864,9 +1907,8 @@ } /* Does at least the first segment of SKB fit into the send window? */ @@ -6546,7 +6469,7 @@ index 638d7b49ad71..d246e537e686 100644 { u32 end_seq = TCP_SKB_CB(skb)->end_seq; -@@ -1875,6 +1917,7 @@ static bool tcp_snd_wnd_test(const struct tcp_sock *tp, +@@ -1875,6 +1917,7 @@ return !after(end_seq, tcp_wnd_end(tp)); } @@ -6554,7 +6477,7 @@ index 638d7b49ad71..d246e537e686 100644 /* Trim TSO SKB to LEN bytes, put the remaining data into a new packet * which is put after SKB on the list. It is very much like -@@ -2033,7 +2076,8 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb, +@@ -2033,7 +2076,8 @@ /* If this packet won't get more data, do not wait. */ if ((TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) || @@ -6564,7 +6487,7 @@ index 638d7b49ad71..d246e537e686 100644 goto send_now; return true; -@@ -2366,7 +2410,7 @@ void tcp_chrono_stop(struct sock *sk, const enum tcp_chrono type) +@@ -2366,7 +2410,7 @@ * Returns true, if no segments are in flight and we have queued segments, * but cannot send anything now because of SWS or another problem. */ @@ -6573,7 +6496,7 @@ index 638d7b49ad71..d246e537e686 100644 int push_one, gfp_t gfp) { struct tcp_sock *tp = tcp_sk(sk); -@@ -2380,7 +2424,12 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, +@@ -2380,7 +2424,12 @@ sent_pkts = 0; tcp_mstamp_refresh(tp); @@ -6587,7 +6510,7 @@ index 638d7b49ad71..d246e537e686 100644 /* Do MTU probing. */ result = tcp_mtu_probe(sk); if (!result) { -@@ -2576,7 +2625,7 @@ void tcp_send_loss_probe(struct sock *sk) +@@ -2576,7 +2625,7 @@ skb = tcp_send_head(sk); if (skb && tcp_snd_wnd_test(tp, skb, mss)) { pcount = tp->packets_out; @@ -6596,7 +6519,7 @@ index 638d7b49ad71..d246e537e686 100644 if (tp->packets_out > pcount) goto probe_sent; goto rearm_timer; -@@ -2638,8 +2687,8 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, +@@ -2638,8 +2687,8 @@ if (unlikely(sk->sk_state == TCP_CLOSE)) return; @@ -6607,7 +6530,7 @@ index 638d7b49ad71..d246e537e686 100644 tcp_check_probe_timer(sk); } -@@ -2652,7 +2701,8 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now) +@@ -2652,7 +2701,8 @@ BUG_ON(!skb || skb->len < mss_now); @@ -6617,7 +6540,7 @@ index 638d7b49ad71..d246e537e686 100644 } /* This function returns the amount that we can raise the -@@ -2874,6 +2924,10 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *to, +@@ -2874,6 +2924,10 @@ if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) return; @@ -6628,7 +6551,7 @@ index 638d7b49ad71..d246e537e686 100644 skb_rbtree_walk_from_safe(skb, tmp) { if (!tcp_can_collapse(sk, skb)) break; -@@ -3355,7 +3409,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst, +@@ -3355,7 +3409,7 @@ /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ th->window = htons(min(req->rsk_rcv_wnd, 65535U)); @@ -6637,7 +6560,7 @@ index 638d7b49ad71..d246e537e686 100644 th->doff = (tcp_header_size >> 2); __TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); -@@ -3437,13 +3491,13 @@ static void tcp_connect_init(struct sock *sk) +@@ -3437,13 +3491,13 @@ if (rcv_wnd == 0) rcv_wnd = dst_metric(dst, RTAX_INITRWND); @@ -6658,7 +6581,7 @@ index 638d7b49ad71..d246e537e686 100644 tp->rx_opt.rcv_wscale = rcv_wscale; tp->rcv_ssthresh = tp->rcv_wnd; -@@ -3463,11 +3517,43 @@ static void tcp_connect_init(struct sock *sk) +@@ -3463,11 +3517,43 @@ else tp->rcv_tstamp = tcp_jiffies32; tp->rcv_wup = tp->rcv_nxt; @@ -6702,7 +6625,7 @@ index 638d7b49ad71..d246e537e686 100644 } static void tcp_connect_queue_skb(struct sock *sk, struct sk_buff *skb) -@@ -3731,6 +3817,7 @@ void tcp_send_ack(struct sock *sk) +@@ -3731,6 +3817,7 @@ { __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); } @@ -6710,7 +6633,7 @@ index 638d7b49ad71..d246e537e686 100644 /* This routine sends a packet with an out of date sequence * number. It assumes the other end will try to ack it. -@@ -3743,7 +3830,7 @@ void tcp_send_ack(struct sock *sk) +@@ -3743,7 +3830,7 @@ * one is with SEG.SEQ=SND.UNA to deliver urgent pointer, another is * out-of-date with SND.UNA-1 to probe window. */ @@ -6719,7 +6642,7 @@ index 638d7b49ad71..d246e537e686 100644 { struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb; -@@ -3830,7 +3917,7 @@ void tcp_send_probe0(struct sock *sk) +@@ -3830,7 +3917,7 @@ unsigned long timeout; int err; @@ -6728,10 +6651,9 @@ index 638d7b49ad71..d246e537e686 100644 if (tp->packets_out || tcp_write_queue_empty(sk)) { /* Cancel probe timer, if it is not required. */ -diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c -index fa2ae96ecdc4..36199efe2837 100644 ---- a/net/ipv4/tcp_timer.c -+++ b/net/ipv4/tcp_timer.c +diff -aurN linux-5.4.155/net/ipv4/tcp_timer.c mptcp-mptcp_v0.96/net/ipv4/tcp_timer.c +--- linux-5.4.155/net/ipv4/tcp_timer.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv4/tcp_timer.c 2021-10-25 10:05:18.000000000 +0200 @@ -21,6 +21,7 @@ #include @@ -6740,7 +6662,7 @@ index fa2ae96ecdc4..36199efe2837 100644 #include static u32 tcp_clamp_rto_to_user_timeout(const struct sock *sk) -@@ -65,7 +66,7 @@ u32 tcp_clamp_probe0_to_user_timeout(const struct sock *sk, u32 when) +@@ -65,7 +66,7 @@ * Returns: Nothing (void) */ @@ -6749,7 +6671,7 @@ index fa2ae96ecdc4..36199efe2837 100644 { sk->sk_err = sk->sk_err_soft ? : ETIMEDOUT; sk->sk_error_report(sk); -@@ -121,7 +122,7 @@ static int tcp_out_of_resources(struct sock *sk, bool do_reset) +@@ -121,7 +122,7 @@ (!tp->snd_wnd && !tp->packets_out)) do_reset = true; if (do_reset) @@ -6758,7 +6680,7 @@ index fa2ae96ecdc4..36199efe2837 100644 tcp_done(sk); __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY); return 1; -@@ -206,9 +207,9 @@ static unsigned int tcp_model_timeout(struct sock *sk, +@@ -206,9 +207,9 @@ * after "boundary" unsuccessful, exponentially backed-off * retransmissions with an initial RTO of TCP_RTO_MIN. */ @@ -6771,7 +6693,7 @@ index fa2ae96ecdc4..36199efe2837 100644 { unsigned int start_ts; -@@ -228,7 +229,7 @@ static bool retransmits_timed_out(struct sock *sk, +@@ -228,7 +229,7 @@ } /* A write timeout has occurred. Process the after effects. */ @@ -6780,7 +6702,7 @@ index fa2ae96ecdc4..36199efe2837 100644 { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); -@@ -243,6 +244,17 @@ static int tcp_write_timeout(struct sock *sk) +@@ -243,6 +244,17 @@ sk_rethink_txhash(sk); } retry_until = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_syn_retries; @@ -6798,7 +6720,7 @@ index fa2ae96ecdc4..36199efe2837 100644 expired = icsk->icsk_retransmits >= retry_until; } else { if (retransmits_timed_out(sk, net->ipv4.sysctl_tcp_retries1, 0)) { -@@ -338,18 +350,22 @@ static void tcp_delack_timer(struct timer_list *t) +@@ -338,18 +350,22 @@ struct inet_connection_sock *icsk = from_timer(icsk, t, icsk_delack_timer); struct sock *sk = &icsk->icsk_inet.sk; @@ -6825,7 +6747,7 @@ index fa2ae96ecdc4..36199efe2837 100644 sock_put(sk); } -@@ -393,7 +409,12 @@ static void tcp_probe_timer(struct sock *sk) +@@ -393,7 +409,12 @@ } if (icsk->icsk_probes_out >= max_probes) { @@ -6839,7 +6761,7 @@ index fa2ae96ecdc4..36199efe2837 100644 } else { /* Only send another probe if we didn't close things up. */ tcp_send_probe0(sk); -@@ -614,7 +635,7 @@ void tcp_write_timer_handler(struct sock *sk) +@@ -614,7 +635,7 @@ break; case ICSK_TIME_RETRANS: icsk->icsk_pending = 0; @@ -6848,7 +6770,7 @@ index fa2ae96ecdc4..36199efe2837 100644 break; case ICSK_TIME_PROBE0: icsk->icsk_pending = 0; -@@ -631,16 +652,19 @@ static void tcp_write_timer(struct timer_list *t) +@@ -631,16 +652,19 @@ struct inet_connection_sock *icsk = from_timer(icsk, t, icsk_retransmit_timer); struct sock *sk = &icsk->icsk_inet.sk; @@ -6871,7 +6793,7 @@ index fa2ae96ecdc4..36199efe2837 100644 sock_put(sk); } -@@ -670,11 +694,12 @@ static void tcp_keepalive_timer (struct timer_list *t) +@@ -670,11 +694,12 @@ struct sock *sk = from_timer(sk, t, sk_timer); struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); @@ -6886,7 +6808,7 @@ index fa2ae96ecdc4..36199efe2837 100644 /* Try again later. */ inet_csk_reset_keepalive_timer (sk, HZ/20); goto out; -@@ -686,16 +711,31 @@ static void tcp_keepalive_timer (struct timer_list *t) +@@ -686,16 +711,31 @@ } tcp_mstamp_refresh(tp); @@ -6920,7 +6842,7 @@ index fa2ae96ecdc4..36199efe2837 100644 goto death; } -@@ -720,11 +760,11 @@ static void tcp_keepalive_timer (struct timer_list *t) +@@ -720,11 +760,11 @@ icsk->icsk_probes_out > 0) || (icsk->icsk_user_timeout == 0 && icsk->icsk_probes_out >= keepalive_probes(tp))) { @@ -6934,7 +6856,7 @@ index fa2ae96ecdc4..36199efe2837 100644 icsk->icsk_probes_out++; elapsed = keepalive_intvl_when(tp); } else { -@@ -748,7 +788,7 @@ static void tcp_keepalive_timer (struct timer_list *t) +@@ -748,7 +788,7 @@ tcp_done(sk); out: @@ -6943,11 +6865,10 @@ index fa2ae96ecdc4..36199efe2837 100644 sock_put(sk); } -diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c -index 366c3792b860..edf439019e37 100644 ---- a/net/ipv6/addrconf.c -+++ b/net/ipv6/addrconf.c -@@ -967,6 +967,7 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp) +diff -aurN linux-5.4.155/net/ipv6/addrconf.c mptcp-mptcp_v0.96/net/ipv6/addrconf.c +--- linux-5.4.155/net/ipv6/addrconf.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv6/addrconf.c 2021-10-25 10:05:18.000000000 +0200 +@@ -967,6 +967,7 @@ kfree_rcu(ifp, rcu); } @@ -6955,11 +6876,10 @@ index 366c3792b860..edf439019e37 100644 static void ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) -diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c -index 14ac1d911287..a3c93ec02c96 100644 ---- a/net/ipv6/af_inet6.c -+++ b/net/ipv6/af_inet6.c -@@ -104,8 +104,7 @@ static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) +diff -aurN linux-5.4.155/net/ipv6/af_inet6.c mptcp-mptcp_v0.96/net/ipv6/af_inet6.c +--- linux-5.4.155/net/ipv6/af_inet6.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv6/af_inet6.c 2021-10-25 10:05:18.000000000 +0200 +@@ -104,8 +104,7 @@ return (struct ipv6_pinfo *)(((u8 *)sk) + offset); } @@ -6969,10 +6889,9 @@ index 14ac1d911287..a3c93ec02c96 100644 { struct inet_sock *inet; struct ipv6_pinfo *np; -diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c -index 5352c7e68c42..534a9d2e4858 100644 ---- a/net/ipv6/ipv6_sockglue.c -+++ b/net/ipv6/ipv6_sockglue.c +diff -aurN linux-5.4.155/net/ipv6/ipv6_sockglue.c mptcp-mptcp_v0.96/net/ipv6/ipv6_sockglue.c +--- linux-5.4.155/net/ipv6/ipv6_sockglue.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv6/ipv6_sockglue.c 2021-10-25 10:05:18.000000000 +0200 @@ -44,6 +44,8 @@ #include #include @@ -6982,7 +6901,7 @@ index 5352c7e68c42..534a9d2e4858 100644 #include #include #include -@@ -221,7 +223,12 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, +@@ -221,7 +223,12 @@ sock_prot_inuse_add(net, &tcp_prot, 1); local_bh_enable(); sk->sk_prot = &tcp_prot; @@ -6996,7 +6915,7 @@ index 5352c7e68c42..534a9d2e4858 100644 sk->sk_socket->ops = &inet_stream_ops; sk->sk_family = PF_INET; tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); -@@ -345,6 +352,17 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, +@@ -345,6 +352,17 @@ if (val == -1) val = 0; np->tclass = val; @@ -7014,10 +6933,9 @@ index 5352c7e68c42..534a9d2e4858 100644 retv = 0; break; -diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c -index ec155844012b..225c015b60a8 100644 ---- a/net/ipv6/syncookies.c -+++ b/net/ipv6/syncookies.c +diff -aurN linux-5.4.155/net/ipv6/syncookies.c mptcp-mptcp_v0.96/net/ipv6/syncookies.c +--- linux-5.4.155/net/ipv6/syncookies.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv6/syncookies.c 2021-10-25 10:05:18.000000000 +0200 @@ -15,6 +15,8 @@ #include #include @@ -7027,7 +6945,7 @@ index ec155844012b..225c015b60a8 100644 #include #define COOKIEBITS 24 /* Upper bits store count */ -@@ -106,7 +108,8 @@ u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, +@@ -106,7 +108,8 @@ } EXPORT_SYMBOL_GPL(__cookie_v6_init_sequence); @@ -7037,7 +6955,7 @@ index ec155844012b..225c015b60a8 100644 { const struct ipv6hdr *iph = ipv6_hdr(skb); const struct tcphdr *th = tcp_hdr(skb); -@@ -128,6 +131,7 @@ EXPORT_SYMBOL_GPL(__cookie_v6_check); +@@ -128,6 +131,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) { struct tcp_options_received tcp_opt; @@ -7045,7 +6963,7 @@ index ec155844012b..225c015b60a8 100644 struct inet_request_sock *ireq; struct tcp_request_sock *treq; struct ipv6_pinfo *np = inet6_sk(sk); -@@ -157,7 +161,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) +@@ -157,7 +161,8 @@ /* check for timestamp cookie support */ memset(&tcp_opt, 0, sizeof(tcp_opt)); @@ -7055,7 +6973,7 @@ index ec155844012b..225c015b60a8 100644 if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) { tsoff = secure_tcpv6_ts_off(sock_net(sk), -@@ -170,14 +175,27 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) +@@ -170,14 +175,27 @@ goto out; ret = NULL; @@ -7084,7 +7002,7 @@ index ec155844012b..225c015b60a8 100644 if (security_inet_conn_request(sk, skb, req)) goto out_free; -@@ -247,15 +265,15 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) +@@ -247,15 +265,15 @@ (req->rsk_window_clamp > full_space || req->rsk_window_clamp == 0)) req->rsk_window_clamp = full_space; @@ -7105,10 +7023,9 @@ index ec155844012b..225c015b60a8 100644 out: return ret; out_free: -diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c -index 3903cc0ab188..2f91fddabceb 100644 ---- a/net/ipv6/tcp_ipv6.c -+++ b/net/ipv6/tcp_ipv6.c +diff -aurN linux-5.4.155/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.96/net/ipv6/tcp_ipv6.c +--- linux-5.4.155/net/ipv6/tcp_ipv6.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/ipv6/tcp_ipv6.c 2021-10-25 10:05:18.000000000 +0200 @@ -58,6 +58,8 @@ #include #include @@ -7134,7 +7051,7 @@ index 3903cc0ab188..2f91fddabceb 100644 #ifdef CONFIG_TCP_MD5SIG static const struct tcp_sock_af_ops tcp_sock_ipv6_specific; static const struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific; -@@ -99,7 +92,7 @@ static struct ipv6_pinfo *tcp_inet6_sk(const struct sock *sk) +@@ -99,7 +92,7 @@ return (struct ipv6_pinfo *)(((u8 *)sk) + offset); } @@ -7143,7 +7060,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { struct dst_entry *dst = skb_dst(skb); -@@ -141,7 +134,7 @@ static int tcp_v6_pre_connect(struct sock *sk, struct sockaddr *uaddr, +@@ -141,7 +134,7 @@ return BPF_CGROUP_RUN_PROG_INET6_CONNECT(sk, uaddr); } @@ -7152,7 +7069,7 @@ index 3903cc0ab188..2f91fddabceb 100644 int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; -@@ -157,6 +150,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, +@@ -157,6 +150,8 @@ int err; struct inet_timewait_death_row *tcp_death_row = &sock_net(sk)->ipv4.tcp_death_row; @@ -7161,7 +7078,7 @@ index 3903cc0ab188..2f91fddabceb 100644 if (addr_len < SIN6_LEN_RFC2133) return -EINVAL; -@@ -236,7 +231,12 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, +@@ -236,7 +231,12 @@ sin.sin_port = usin->sin6_port; sin.sin_addr.s_addr = usin->sin6_addr.s6_addr32[3]; @@ -7175,7 +7092,7 @@ index 3903cc0ab188..2f91fddabceb 100644 sk->sk_backlog_rcv = tcp_v4_do_rcv; #ifdef CONFIG_TCP_MD5SIG tp->af_specific = &tcp_sock_ipv6_mapped_specific; -@@ -246,7 +246,12 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, +@@ -246,7 +246,12 @@ if (err) { icsk->icsk_ext_hdr_len = exthdrlen; @@ -7189,7 +7106,7 @@ index 3903cc0ab188..2f91fddabceb 100644 sk->sk_backlog_rcv = tcp_v6_do_rcv; #ifdef CONFIG_TCP_MD5SIG tp->af_specific = &tcp_sock_ipv6_specific; -@@ -340,7 +345,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, +@@ -340,7 +345,7 @@ return err; } @@ -7198,7 +7115,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { struct dst_entry *dst; u32 mtu; -@@ -376,7 +381,7 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -376,7 +381,7 @@ struct ipv6_pinfo *np; struct tcp_sock *tp; __u32 seq, snd_una; @@ -7207,7 +7124,7 @@ index 3903cc0ab188..2f91fddabceb 100644 bool fatal; int err; -@@ -402,8 +407,14 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -402,8 +407,14 @@ return 0; } @@ -7224,7 +7141,7 @@ index 3903cc0ab188..2f91fddabceb 100644 __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS); if (sk->sk_state == TCP_CLOSE) -@@ -414,7 +425,6 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -414,7 +425,6 @@ goto out; } @@ -7232,10 +7149,10 @@ index 3903cc0ab188..2f91fddabceb 100644 /* XXX (TFO) - tp->snd_una should be ISN (tcp_create_openreq_child() */ fastopen = rcu_dereference(tp->fastopen_rsk); snd_una = fastopen ? tcp_rsk(fastopen)->snt_isn : tp->snd_una; -@@ -454,11 +464,15 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, - - WRITE_ONCE(tp->mtu_info, mtu); +@@ -454,11 +464,15 @@ + goto out; + tp->mtu_info = ntohl(info); - if (!sock_owned_by_user(sk)) + if (!sock_owned_by_user(meta_sk)) { tcp_v6_mtu_reduced(sk); @@ -7252,7 +7169,7 @@ index 3903cc0ab188..2f91fddabceb 100644 goto out; } -@@ -473,7 +487,7 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -473,7 +487,7 @@ if (fastopen && !fastopen->sk) break; @@ -7261,7 +7178,7 @@ index 3903cc0ab188..2f91fddabceb 100644 sk->sk_err = err; sk->sk_error_report(sk); /* Wake people up to see the error (see connect in sock.c) */ -@@ -483,14 +497,14 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -483,14 +497,14 @@ goto out; } @@ -7278,7 +7195,7 @@ index 3903cc0ab188..2f91fddabceb 100644 sock_put(sk); return 0; } -@@ -538,8 +552,7 @@ static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst, +@@ -538,8 +552,7 @@ return err; } @@ -7288,7 +7205,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { kfree(inet_rsk(req)->ipv6_opt); kfree_skb(inet_rsk(req)->pktopts); -@@ -757,9 +770,10 @@ static bool tcp_v6_inbound_md5_hash(const struct sock *sk, +@@ -757,9 +770,10 @@ return false; } @@ -7302,7 +7219,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { bool l3_slave = ipv6_l3mdev_skb(TCP_SKB_CB(skb)->header.h6.flags); struct inet_request_sock *ireq = inet_rsk(req); -@@ -781,6 +795,8 @@ static void tcp_v6_init_req(struct request_sock *req, +@@ -781,6 +795,8 @@ refcount_inc(&skb->users); ireq->pktopts = skb; } @@ -7311,7 +7228,7 @@ index 3903cc0ab188..2f91fddabceb 100644 } static struct dst_entry *tcp_v6_route_req(const struct sock *sk, -@@ -800,7 +816,7 @@ struct request_sock_ops tcp6_request_sock_ops __read_mostly = { +@@ -800,7 +816,7 @@ .syn_ack_timeout = tcp_syn_ack_timeout, }; @@ -7320,7 +7237,7 @@ index 3903cc0ab188..2f91fddabceb 100644 .mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr), #ifdef CONFIG_TCP_MD5SIG -@@ -818,9 +834,9 @@ static const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { +@@ -818,9 +834,9 @@ }; static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 seq, @@ -7332,7 +7249,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { const struct tcphdr *th = tcp_hdr(skb); struct tcphdr *t1; -@@ -839,7 +855,10 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 +@@ -839,7 +855,10 @@ if (key) tot_len += TCPOLEN_MD5SIG_ALIGNED; #endif @@ -7344,7 +7261,7 @@ index 3903cc0ab188..2f91fddabceb 100644 buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len, GFP_ATOMIC); if (!buff) -@@ -877,6 +896,17 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 +@@ -877,6 +896,17 @@ tcp_v6_md5_hash_hdr((__u8 *)topt, key, &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, t1); @@ -7362,7 +7279,7 @@ index 3903cc0ab188..2f91fddabceb 100644 } #endif -@@ -935,7 +965,7 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 +@@ -935,7 +965,7 @@ kfree_skb(buff); } @@ -7371,7 +7288,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { const struct tcphdr *th = tcp_hdr(skb); struct ipv6hdr *ipv6h = ipv6_hdr(skb); -@@ -1020,8 +1050,8 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb) +@@ -1020,8 +1050,8 @@ label = ip6_flowlabel(ipv6h); } @@ -7382,7 +7299,7 @@ index 3903cc0ab188..2f91fddabceb 100644 #ifdef CONFIG_TCP_MD5SIG out: -@@ -1030,30 +1060,37 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb) +@@ -1030,30 +1060,37 @@ } static void tcp_v6_send_ack(const struct sock *sk, struct sk_buff *skb, u32 seq, @@ -7427,7 +7344,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { /* sk->sk_state == TCP_LISTEN -> for regular TCP_SYN_RECV * sk->sk_state == TCP_SYN_RECV -> for Fast Open. -@@ -1063,18 +1100,18 @@ static void tcp_v6_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, +@@ -1063,18 +1100,18 @@ * exception of segments, MUST be right-shifted by * Rcv.Wind.Shift bits: */ @@ -7450,7 +7367,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { #ifdef CONFIG_SYN_COOKIES const struct tcphdr *th = tcp_hdr(skb); -@@ -1100,7 +1137,7 @@ u16 tcp_v6_get_syncookie(struct sock *sk, struct ipv6hdr *iph, +@@ -1100,7 +1137,7 @@ return mss; } @@ -7459,7 +7376,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { if (skb->protocol == htons(ETH_P_IP)) return tcp_v4_conn_request(sk, skb); -@@ -1131,11 +1168,11 @@ static void tcp_v6_restore_cb(struct sk_buff *skb) +@@ -1131,11 +1168,11 @@ sizeof(struct inet6_skb_parm)); } @@ -7476,7 +7393,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { struct inet_request_sock *ireq; struct ipv6_pinfo *newnp; -@@ -1170,7 +1207,15 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff * +@@ -1170,7 +1207,15 @@ newnp->saddr = newsk->sk_v6_rcv_saddr; @@ -7493,7 +7410,7 @@ index 3903cc0ab188..2f91fddabceb 100644 newsk->sk_backlog_rcv = tcp_v4_do_rcv; #ifdef CONFIG_TCP_MD5SIG newtp->af_specific = &tcp_sock_ipv6_mapped_specific; -@@ -1217,6 +1262,14 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff * +@@ -1217,6 +1262,14 @@ if (!newsk) goto out_nonewsk; @@ -7508,7 +7425,7 @@ index 3903cc0ab188..2f91fddabceb 100644 /* * No need to charge this sock to the relevant IPv6 refcnt debug socks * count here, tcp_create_openreq_child now does this for us, see the -@@ -1344,7 +1397,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff * +@@ -1344,7 +1397,7 @@ * This is because we cannot sleep with the original spinlock * held. */ @@ -7517,7 +7434,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { struct ipv6_pinfo *np = tcp_inet6_sk(sk); struct sk_buff *opt_skb = NULL; -@@ -1361,6 +1414,9 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) +@@ -1361,6 +1414,9 @@ if (skb->protocol == htons(ETH_P_IP)) return tcp_v4_do_rcv(sk, skb); @@ -7527,7 +7444,7 @@ index 3903cc0ab188..2f91fddabceb 100644 /* * socket locking is here for SMP purposes as backlog rcv * is currently called with bh processing disabled. -@@ -1488,6 +1544,10 @@ static void tcp_v6_fill_cb(struct sk_buff *skb, const struct ipv6hdr *hdr, +@@ -1488,6 +1544,10 @@ TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + skb->len - th->doff*4); TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); @@ -7538,7 +7455,7 @@ index 3903cc0ab188..2f91fddabceb 100644 TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th); TCP_SKB_CB(skb)->tcp_tw_isn = 0; TCP_SKB_CB(skb)->ip_dsfield = ipv6_get_dsfield(hdr); -@@ -1502,8 +1562,8 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) +@@ -1502,8 +1562,8 @@ int sdif = inet6_sdif(skb); const struct tcphdr *th; const struct ipv6hdr *hdr; @@ -7548,7 +7465,7 @@ index 3903cc0ab188..2f91fddabceb 100644 int ret; struct net *net = dev_net(skb->dev); -@@ -1557,12 +1617,17 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) +@@ -1557,12 +1617,17 @@ reqsk_put(req); goto csum_error; } @@ -7567,7 +7484,7 @@ index 3903cc0ab188..2f91fddabceb 100644 nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; -@@ -1621,19 +1686,28 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) +@@ -1621,19 +1686,28 @@ sk_incoming_cpu_update(sk); @@ -7600,7 +7517,7 @@ index 3903cc0ab188..2f91fddabceb 100644 if (skb_to_free) __kfree_skb(skb_to_free); put_and_return: -@@ -1647,6 +1721,19 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) +@@ -1647,6 +1721,19 @@ tcp_v6_fill_cb(skb, hdr, th); @@ -7620,7 +7537,7 @@ index 3903cc0ab188..2f91fddabceb 100644 if (tcp_checksum_complete(skb)) { csum_error: __TCP_INC_STATS(net, TCP_MIB_CSUMERRORS); -@@ -1699,6 +1786,18 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) +@@ -1699,6 +1786,18 @@ refcounted = false; goto process; } @@ -7639,7 +7556,7 @@ index 3903cc0ab188..2f91fddabceb 100644 } /* to ACK */ /* fall through */ -@@ -1753,13 +1852,13 @@ INDIRECT_CALLABLE_SCOPE void tcp_v6_early_demux(struct sk_buff *skb) +@@ -1753,13 +1852,13 @@ } } @@ -7655,7 +7572,7 @@ index 3903cc0ab188..2f91fddabceb 100644 .queue_xmit = inet6_csk_xmit, .send_check = tcp_v6_send_check, .rebuild_header = inet6_sk_rebuild_header, -@@ -1790,7 +1889,7 @@ static const struct tcp_sock_af_ops tcp_sock_ipv6_specific = { +@@ -1790,7 +1889,7 @@ /* * TCP over IPv4 via INET6 API */ @@ -7664,7 +7581,7 @@ index 3903cc0ab188..2f91fddabceb 100644 .queue_xmit = ip_queue_xmit, .send_check = tcp_v4_send_check, .rebuild_header = inet_sk_rebuild_header, -@@ -1826,7 +1925,12 @@ static int tcp_v6_init_sock(struct sock *sk) +@@ -1826,7 +1925,12 @@ tcp_init_sock(sk); @@ -7678,7 +7595,7 @@ index 3903cc0ab188..2f91fddabceb 100644 #ifdef CONFIG_TCP_MD5SIG tcp_sk(sk)->af_specific = &tcp_sock_ipv6_specific; -@@ -1835,7 +1939,7 @@ static int tcp_v6_init_sock(struct sock *sk) +@@ -1835,7 +1939,7 @@ return 0; } @@ -7687,7 +7604,7 @@ index 3903cc0ab188..2f91fddabceb 100644 { tcp_v4_destroy_sock(sk); inet6_destroy_sock(sk); -@@ -2058,6 +2162,11 @@ struct proto tcpv6_prot = { +@@ -2058,6 +2162,11 @@ .sysctl_rmem_offset = offsetof(struct net, ipv4.sysctl_tcp_rmem), .max_header = MAX_TCP_HEADER, .obj_size = sizeof(struct tcp6_sock), @@ -7699,7 +7616,7 @@ index 3903cc0ab188..2f91fddabceb 100644 .slab_flags = SLAB_TYPESAFE_BY_RCU, .twsk_prot = &tcp6_timewait_sock_ops, .rsk_prot = &tcp6_request_sock_ops, -@@ -2068,6 +2177,9 @@ struct proto tcpv6_prot = { +@@ -2068,6 +2177,9 @@ .compat_getsockopt = compat_tcp_getsockopt, #endif .diag_destroy = tcp_abort, @@ -7709,11 +7626,31 @@ index 3903cc0ab188..2f91fddabceb 100644 }; /* thinking of making this const? Don't. -diff --git a/net/mptcp/Kconfig b/net/mptcp/Kconfig -new file mode 100644 -index 000000000000..6e05dab4c632 ---- /dev/null -+++ b/net/mptcp/Kconfig +diff -aurN linux-5.4.155/net/Kconfig mptcp-mptcp_v0.96/net/Kconfig +--- linux-5.4.155/net/Kconfig 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/Kconfig 2021-10-25 10:05:18.000000000 +0200 +@@ -94,6 +94,7 @@ + source "net/ipv4/Kconfig" + source "net/ipv6/Kconfig" + source "net/netlabel/Kconfig" ++source "net/mptcp/Kconfig" + + endif # if INET + +diff -aurN linux-5.4.155/net/Makefile mptcp-mptcp_v0.96/net/Makefile +--- linux-5.4.155/net/Makefile 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/Makefile 2021-10-25 10:05:18.000000000 +0200 +@@ -20,6 +20,7 @@ + obj-$(CONFIG_XFRM) += xfrm/ + obj-$(CONFIG_UNIX_SCM) += unix/ + obj-$(CONFIG_NET) += ipv6/ ++obj-$(CONFIG_MPTCP) += mptcp/ + obj-$(CONFIG_BPFILTER) += bpfilter/ + obj-$(CONFIG_PACKET) += packet/ + obj-$(CONFIG_NET_KEY) += key/ +diff -aurN linux-5.4.155/net/mptcp/Kconfig mptcp-mptcp_v0.96/net/mptcp/Kconfig +--- linux-5.4.155/net/mptcp/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/Kconfig 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,154 @@ +# +# MPTCP configuration @@ -7869,11 +7806,9 @@ index 000000000000..6e05dab4c632 + default "redundant" if DEFAULT_REDUNDANT + default "default" + -diff --git a/net/mptcp/Makefile b/net/mptcp/Makefile -new file mode 100644 -index 000000000000..369248a2f68e ---- /dev/null -+++ b/net/mptcp/Makefile +diff -aurN linux-5.4.155/net/mptcp/Makefile mptcp-mptcp_v0.96/net/mptcp/Makefile +--- linux-5.4.155/net/mptcp/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/Makefile 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,25 @@ +# +## Makefile for MultiPath TCP support code. @@ -7900,11 +7835,9 @@ index 000000000000..369248a2f68e +obj-$(CONFIG_MPTCP_ECF) += mptcp_ecf.o + +mptcp-$(subst m,y,$(CONFIG_IPV6)) += mptcp_ipv6.o -diff --git a/net/mptcp/mctcp_desync.c b/net/mptcp/mctcp_desync.c -new file mode 100644 -index 000000000000..f6bf9251d59b ---- /dev/null -+++ b/net/mptcp/mctcp_desync.c +diff -aurN linux-5.4.155/net/mptcp/mctcp_desync.c mptcp-mptcp_v0.96/net/mptcp/mctcp_desync.c +--- linux-5.4.155/net/mptcp/mctcp_desync.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mctcp_desync.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,193 @@ +/* + * Desynchronized Multi-Channel TCP Congestion Control Algorithm @@ -8099,11 +8032,9 @@ index 000000000000..f6bf9251d59b +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MCTCP: DESYNCHRONIZED MULTICHANNEL TCP CONGESTION CONTROL"); +MODULE_VERSION("1.0"); -diff --git a/net/mptcp/mptcp_balia.c b/net/mptcp/mptcp_balia.c -new file mode 100644 -index 000000000000..179b53dea020 ---- /dev/null -+++ b/net/mptcp/mptcp_balia.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_balia.c mptcp-mptcp_v0.96/net/mptcp/mptcp_balia.c +--- linux-5.4.155/net/mptcp/mptcp_balia.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_balia.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,261 @@ +/* + * MPTCP implementation - Balia Congestion Control @@ -8366,11 +8297,9 @@ index 000000000000..179b53dea020 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP BALIA CONGESTION CONTROL ALGORITHM"); +MODULE_VERSION("0.1"); -diff --git a/net/mptcp/mptcp_binder.c b/net/mptcp/mptcp_binder.c -new file mode 100644 -index 000000000000..7f34a8d00274 ---- /dev/null -+++ b/net/mptcp/mptcp_binder.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_binder.c mptcp-mptcp_v0.96/net/mptcp/mptcp_binder.c +--- linux-5.4.155/net/mptcp/mptcp_binder.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_binder.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,494 @@ +#include + @@ -8866,11 +8795,9 @@ index 000000000000..7f34a8d00274 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("BINDER MPTCP"); +MODULE_VERSION("0.1"); -diff --git a/net/mptcp/mptcp_blest.c b/net/mptcp/mptcp_blest.c -new file mode 100644 -index 000000000000..22e25dd0d44e ---- /dev/null -+++ b/net/mptcp/mptcp_blest.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_blest.c mptcp-mptcp_v0.96/net/mptcp/mptcp_blest.c +--- linux-5.4.155/net/mptcp/mptcp_blest.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_blest.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,285 @@ +// SPDX-License-Identifier: GPL-2.0 +/* MPTCP Scheduler to reduce HoL-blocking and spurious retransmissions. @@ -9157,11 +9084,9 @@ index 000000000000..22e25dd0d44e +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("BLEST scheduler for MPTCP, based on default minimum RTT scheduler"); +MODULE_VERSION("0.95"); -diff --git a/net/mptcp/mptcp_coupled.c b/net/mptcp/mptcp_coupled.c -new file mode 100644 -index 000000000000..9eb7628053f6 ---- /dev/null -+++ b/net/mptcp/mptcp_coupled.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_coupled.c mptcp-mptcp_v0.96/net/mptcp/mptcp_coupled.c +--- linux-5.4.155/net/mptcp/mptcp_coupled.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_coupled.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,262 @@ +/* + * MPTCP implementation - Linked Increase congestion control Algorithm (LIA) @@ -9425,11 +9350,9 @@ index 000000000000..9eb7628053f6 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP LINKED INCREASE CONGESTION CONTROL ALGORITHM"); +MODULE_VERSION("0.1"); -diff --git a/net/mptcp/mptcp_ctrl.c b/net/mptcp/mptcp_ctrl.c -new file mode 100644 -index 000000000000..db01ec142111 ---- /dev/null -+++ b/net/mptcp/mptcp_ctrl.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_ctrl.c mptcp-mptcp_v0.96/net/mptcp/mptcp_ctrl.c +--- linux-5.4.155/net/mptcp/mptcp_ctrl.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_ctrl.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,3313 @@ +/* + * MPTCP implementation - MPTCP-control @@ -12744,11 +12667,9 @@ index 000000000000..db01ec142111 +mptcp_sock_cache_failed: + mptcp_init_failed = true; +} -diff --git a/net/mptcp/mptcp_ecf.c b/net/mptcp/mptcp_ecf.c -new file mode 100644 -index 000000000000..6b976b2b0c72 ---- /dev/null -+++ b/net/mptcp/mptcp_ecf.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_ecf.c mptcp-mptcp_v0.96/net/mptcp/mptcp_ecf.c +--- linux-5.4.155/net/mptcp/mptcp_ecf.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_ecf.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,195 @@ +// SPDX-License-Identifier: GPL-2.0 +/* MPTCP ECF Scheduler @@ -12945,11 +12866,9 @@ index 000000000000..6b976b2b0c72 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("ECF (Earliest Completion First) scheduler for MPTCP, based on default minimum RTT scheduler"); +MODULE_VERSION("0.95"); -diff --git a/net/mptcp/mptcp_fullmesh.c b/net/mptcp/mptcp_fullmesh.c -new file mode 100644 -index 000000000000..5424960256e6 ---- /dev/null -+++ b/net/mptcp/mptcp_fullmesh.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_fullmesh.c mptcp-mptcp_v0.96/net/mptcp/mptcp_fullmesh.c +--- linux-5.4.155/net/mptcp/mptcp_fullmesh.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_fullmesh.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,1938 @@ +#include +#include @@ -14889,12 +14808,10 @@ index 000000000000..5424960256e6 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Full-Mesh MPTCP"); +MODULE_VERSION("0.88"); -diff --git a/net/mptcp/mptcp_input.c b/net/mptcp/mptcp_input.c -new file mode 100644 -index 000000000000..ae9cc7209613 ---- /dev/null -+++ b/net/mptcp/mptcp_input.c -@@ -0,0 +1,2546 @@ +diff -aurN linux-5.4.155/net/mptcp/mptcp_input.c mptcp-mptcp_v0.96/net/mptcp/mptcp_input.c +--- linux-5.4.155/net/mptcp/mptcp_input.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_input.c 2021-10-25 10:05:18.000000000 +0200 +@@ -0,0 +1,2548 @@ +/* + * MPTCP implementation - Sending side + * @@ -17204,7 +17121,8 @@ index 000000000000..ae9cc7209613 + * comes from __tcp_retransmit_skb(). + */ + if (before(TCP_SKB_CB(skb)->seq, master_tp->snd_una)) { -+ BUG_ON(before(TCP_SKB_CB(skb)->end_seq, master_tp->snd_una)); ++ BUG_ON(before(TCP_SKB_CB(skb)->end_seq, ++ master_tp->snd_una)); + /* tcp_trim_head can only returns ENOMEM if skb is + * cloned. It is not the case here (see + * tcp_send_syn_data). @@ -17221,11 +17139,12 @@ index 000000000000..ae9cc7209613 + + if (rtx_queue) + tcp_rtx_queue_unlink(skb, meta_sk); ++ else ++ tcp_unlink_write_queue(skb, meta_sk); + + INIT_LIST_HEAD(&skb->tcp_tsorted_anchor); + -+ if (rtx_queue) -+ tcp_add_write_queue_tail(meta_sk, skb); ++ tcp_add_write_queue_tail(meta_sk, skb); +} + +/* In case of fastopen, some data can already be in the write queue. @@ -17249,7 +17168,7 @@ index 000000000000..ae9cc7209613 + * this data to data sequence numbers. + */ + -+ BUG_ON(skb_write_head && skb_rtx_head); ++ WARN_ON(skb_write_head && skb_rtx_head); + + if (skb_write_head) { + skb_queue_walk_from_safe(&meta_sk->sk_write_queue, @@ -17441,11 +17360,9 @@ index 000000000000..ae9cc7209613 + tcp_set_rto(sk); + mptcp_set_rto(sk); +} -diff --git a/net/mptcp/mptcp_ipv4.c b/net/mptcp/mptcp_ipv4.c -new file mode 100644 -index 000000000000..0370a7680d47 ---- /dev/null -+++ b/net/mptcp/mptcp_ipv4.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_ipv4.c mptcp-mptcp_v0.96/net/mptcp/mptcp_ipv4.c +--- linux-5.4.155/net/mptcp/mptcp_ipv4.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_ipv4.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,431 @@ +/* + * MPTCP implementation - IPv4-specific functions @@ -17878,11 +17795,9 @@ index 000000000000..0370a7680d47 + kmem_cache_destroy(mptcp_request_sock_ops.slab); + kfree(mptcp_request_sock_ops.slab_name); +} -diff --git a/net/mptcp/mptcp_ipv6.c b/net/mptcp/mptcp_ipv6.c -new file mode 100644 -index 000000000000..8af32df4fd5f ---- /dev/null -+++ b/net/mptcp/mptcp_ipv6.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_ipv6.c mptcp-mptcp_v0.96/net/mptcp/mptcp_ipv6.c +--- linux-5.4.155/net/mptcp/mptcp_ipv6.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_ipv6.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,479 @@ +/* + * MPTCP implementation - IPv6-specific functions @@ -18363,11 +18278,9 @@ index 000000000000..8af32df4fd5f + kmem_cache_destroy(mptcp6_request_sock_ops.slab); + kfree(mptcp6_request_sock_ops.slab_name); +} -diff --git a/net/mptcp/mptcp_ndiffports.c b/net/mptcp/mptcp_ndiffports.c -new file mode 100644 -index 000000000000..cf019990447c ---- /dev/null -+++ b/net/mptcp/mptcp_ndiffports.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_ndiffports.c mptcp-mptcp_v0.96/net/mptcp/mptcp_ndiffports.c +--- linux-5.4.155/net/mptcp/mptcp_ndiffports.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_ndiffports.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,174 @@ +#include + @@ -18543,11 +18456,9 @@ index 000000000000..cf019990447c +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("NDIFF-PORTS MPTCP"); +MODULE_VERSION("0.88"); -diff --git a/net/mptcp/mptcp_netlink.c b/net/mptcp/mptcp_netlink.c -new file mode 100644 -index 000000000000..dd696841ea85 ---- /dev/null -+++ b/net/mptcp/mptcp_netlink.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_netlink.c mptcp-mptcp_v0.96/net/mptcp/mptcp_netlink.c +--- linux-5.4.155/net/mptcp/mptcp_netlink.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_netlink.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,1272 @@ +// SPDX-License-Identifier: GPL-2.0 +/* MPTCP implementation - Netlink Path Manager @@ -19821,11 +19732,9 @@ index 000000000000..dd696841ea85 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP netlink-based path manager"); +MODULE_ALIAS_GENL_FAMILY(MPTCP_GENL_NAME); -diff --git a/net/mptcp/mptcp_olia.c b/net/mptcp/mptcp_olia.c -new file mode 100644 -index 000000000000..c44eb9208581 ---- /dev/null -+++ b/net/mptcp/mptcp_olia.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_olia.c mptcp-mptcp_v0.96/net/mptcp/mptcp_olia.c +--- linux-5.4.155/net/mptcp/mptcp_olia.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_olia.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,318 @@ +/* + * MPTCP implementation - OPPORTUNISTIC LINKED INCREASES CONGESTION CONTROL: @@ -20145,11 +20054,9 @@ index 000000000000..c44eb9208581 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP COUPLED CONGESTION CONTROL"); +MODULE_VERSION("0.1"); -diff --git a/net/mptcp/mptcp_output.c b/net/mptcp/mptcp_output.c -new file mode 100644 -index 000000000000..39eae2199802 ---- /dev/null -+++ b/net/mptcp/mptcp_output.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_output.c mptcp-mptcp_v0.96/net/mptcp/mptcp_output.c +--- linux-5.4.155/net/mptcp/mptcp_output.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_output.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,2009 @@ +/* + * MPTCP implementation - Sending side @@ -22160,11 +22067,9 @@ index 000000000000..39eae2199802 + return max(xmit_size_goal, mss_now); +} + -diff --git a/net/mptcp/mptcp_pm.c b/net/mptcp/mptcp_pm.c -new file mode 100644 -index 000000000000..0e24e0aaa70a ---- /dev/null -+++ b/net/mptcp/mptcp_pm.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_pm.c mptcp-mptcp_v0.96/net/mptcp/mptcp_pm.c +--- linux-5.4.155/net/mptcp/mptcp_pm.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_pm.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,226 @@ +/* + * MPTCP implementation - MPTCP-subflow-management @@ -22392,11 +22297,9 @@ index 000000000000..0e24e0aaa70a + return mptcp_set_default_path_manager(CONFIG_DEFAULT_MPTCP_PM); +} +late_initcall(mptcp_path_manager_default); -diff --git a/net/mptcp/mptcp_redundant.c b/net/mptcp/mptcp_redundant.c -new file mode 100644 -index 000000000000..3db4e69acef2 ---- /dev/null -+++ b/net/mptcp/mptcp_redundant.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_redundant.c mptcp-mptcp_v0.96/net/mptcp/mptcp_redundant.c +--- linux-5.4.155/net/mptcp/mptcp_redundant.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_redundant.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,395 @@ +/* + * MPTCP Scheduler to reduce latency and jitter. @@ -22793,11 +22696,9 @@ index 000000000000..3db4e69acef2 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("REDUNDANT MPTCP"); +MODULE_VERSION("0.90"); -diff --git a/net/mptcp/mptcp_rr.c b/net/mptcp/mptcp_rr.c -new file mode 100644 -index 000000000000..396e8aaf4762 ---- /dev/null -+++ b/net/mptcp/mptcp_rr.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_rr.c mptcp-mptcp_v0.96/net/mptcp/mptcp_rr.c +--- linux-5.4.155/net/mptcp/mptcp_rr.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_rr.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,309 @@ +/* MPTCP Scheduler module selector. Highly inspired by tcp_cong.c */ + @@ -23108,11 +23009,9 @@ index 000000000000..396e8aaf4762 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("ROUNDROBIN MPTCP"); +MODULE_VERSION("0.89"); -diff --git a/net/mptcp/mptcp_sched.c b/net/mptcp/mptcp_sched.c -new file mode 100644 -index 000000000000..eed9bfb44b59 ---- /dev/null -+++ b/net/mptcp/mptcp_sched.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_sched.c mptcp-mptcp_v0.96/net/mptcp/mptcp_sched.c +--- linux-5.4.155/net/mptcp/mptcp_sched.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_sched.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,677 @@ +/* MPTCP Scheduler module selector. Highly inspired by tcp_cong.c */ + @@ -23791,11 +23690,9 @@ index 000000000000..eed9bfb44b59 + return mptcp_set_default_scheduler(CONFIG_DEFAULT_MPTCP_SCHED); +} +late_initcall(mptcp_scheduler_default); -diff --git a/net/mptcp/mptcp_wvegas.c b/net/mptcp/mptcp_wvegas.c -new file mode 100644 -index 000000000000..787ddaab98a2 ---- /dev/null -+++ b/net/mptcp/mptcp_wvegas.c +diff -aurN linux-5.4.155/net/mptcp/mptcp_wvegas.c mptcp-mptcp_v0.96/net/mptcp/mptcp_wvegas.c +--- linux-5.4.155/net/mptcp/mptcp_wvegas.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.96/net/mptcp/mptcp_wvegas.c 2021-10-25 10:05:18.000000000 +0200 @@ -0,0 +1,271 @@ +/* + * MPTCP implementation - WEIGHTED VEGAS @@ -24068,10 +23965,9 @@ index 000000000000..787ddaab98a2 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP wVegas"); +MODULE_VERSION("0.1"); -diff --git a/net/socket.c b/net/socket.c -index 94358566c9d1..a26eeeda2b4d 100644 ---- a/net/socket.c -+++ b/net/socket.c +diff -aurN linux-5.4.155/net/socket.c mptcp-mptcp_v0.96/net/socket.c +--- linux-5.4.155/net/socket.c 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/net/socket.c 2021-10-25 10:05:18.000000000 +0200 @@ -91,6 +91,7 @@ #include @@ -24080,7 +23976,7 @@ index 94358566c9d1..a26eeeda2b4d 100644 #include #include -@@ -1339,6 +1340,7 @@ int __sock_create(struct net *net, int family, int type, int protocol, +@@ -1339,6 +1340,7 @@ int err; struct socket *sock; const struct net_proto_family *pf; @@ -24088,7 +23984,7 @@ index 94358566c9d1..a26eeeda2b4d 100644 /* * Check protocol is in range -@@ -1359,6 +1361,9 @@ int __sock_create(struct net *net, int family, int type, int protocol, +@@ -1359,6 +1361,9 @@ family = PF_PACKET; } @@ -24098,7 +23994,7 @@ index 94358566c9d1..a26eeeda2b4d 100644 err = security_socket_create(family, type, protocol, kern); if (err) return err; -@@ -1408,6 +1413,10 @@ int __sock_create(struct net *net, int family, int type, int protocol, +@@ -1408,6 +1413,10 @@ if (err < 0) goto out_module_put; @@ -24109,11 +24005,10 @@ index 94358566c9d1..a26eeeda2b4d 100644 /* * Now to bump the refcnt of the [loadable] module that owns this * socket at sock_release time we decrement its refcnt. -diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h -index 63038eb23560..7150eb62db86 100644 ---- a/tools/include/uapi/linux/bpf.h -+++ b/tools/include/uapi/linux/bpf.h -@@ -3438,6 +3438,7 @@ enum { +diff -aurN linux-5.4.155/tools/include/uapi/linux/bpf.h mptcp-mptcp_v0.96/tools/include/uapi/linux/bpf.h +--- linux-5.4.155/tools/include/uapi/linux/bpf.h 2021-10-20 11:40:18.000000000 +0200 ++++ mptcp-mptcp_v0.96/tools/include/uapi/linux/bpf.h 2021-10-25 10:05:18.000000000 +0200 +@@ -3438,6 +3438,7 @@ BPF_TCP_LISTEN, BPF_TCP_CLOSING, /* Now a valid state */ BPF_TCP_NEW_SYN_RECV,