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