From fb4a368c844f88fc9bbaeb1053bc659f5ed142ed Mon Sep 17 00:00:00 2001 From: Ycarus Date: Mon, 27 Aug 2018 11:02:00 +0200 Subject: [PATCH] Update MPTCP patch --- .../generic/hack-4.14/690-mptcp_v0.94.patch | 923 ++++++++---------- 1 file changed, 406 insertions(+), 517 deletions(-) diff --git a/root/target/linux/generic/hack-4.14/690-mptcp_v0.94.patch b/root/target/linux/generic/hack-4.14/690-mptcp_v0.94.patch index 22b5bd16..94fafcd1 100644 --- a/root/target/linux/generic/hack-4.14/690-mptcp_v0.94.patch +++ b/root/target/linux/generic/hack-4.14/690-mptcp_v0.94.patch @@ -1,6 +1,6 @@ -diff -aurN linux-4.14.41/Documentation/networking/ip-sysctl.txt mptcp-mptcp_v0.94/Documentation/networking/ip-sysctl.txt ---- linux-4.14.41/Documentation/networking/ip-sysctl.txt 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/Documentation/networking/ip-sysctl.txt 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt +--- a/Documentation/networking/ip-sysctl.txt 2018-08-17 21:01:12.000000000 +0200 ++++ b/Documentation/networking/ip-sysctl.txt 2018-08-22 02:56:26.000000000 +0200 @@ -728,6 +728,18 @@ in RFC 5961 (Improving TCP's Robustness to Blind In-Window Attacks) Default: 100 @@ -20,9 +20,9 @@ diff -aurN linux-4.14.41/Documentation/networking/ip-sysctl.txt mptcp-mptcp_v0.9 UDP variables: udp_l3mdev_accept - BOOLEAN -diff -aurN linux-4.14.41/drivers/infiniband/hw/cxgb4/cm.c mptcp-mptcp_v0.94/drivers/infiniband/hw/cxgb4/cm.c ---- linux-4.14.41/drivers/infiniband/hw/cxgb4/cm.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/drivers/infiniband/hw/cxgb4/cm.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c +--- a/drivers/infiniband/hw/cxgb4/cm.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/drivers/infiniband/hw/cxgb4/cm.c 2018-08-22 02:56:26.000000000 +0200 @@ -3752,7 +3752,7 @@ */ memset(&tmp_opt, 0, sizeof(tmp_opt)); @@ -32,10 +32,10 @@ diff -aurN linux-4.14.41/drivers/infiniband/hw/cxgb4/cm.c mptcp-mptcp_v0.94/driv req = __skb_push(skb, sizeof(*req)); memset(req, 0, sizeof(*req)); -diff -aurN linux-4.14.41/include/linux/skbuff.h mptcp-mptcp_v0.94/include/linux/skbuff.h ---- linux-4.14.41/include/linux/skbuff.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/linux/skbuff.h 2018-07-20 10:46:09.000000000 +0200 -@@ -684,7 +684,7 @@ +diff -aurN a/include/linux/skbuff.h b/include/linux/skbuff.h +--- a/include/linux/skbuff.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/linux/skbuff.h 2018-08-22 02:56:26.000000000 +0200 +@@ -685,7 +685,7 @@ * want to keep them across layers you have to do a skb_clone() * first. This is owned by whoever has the skb queued ATM. */ @@ -44,9 +44,9 @@ diff -aurN linux-4.14.41/include/linux/skbuff.h mptcp-mptcp_v0.94/include/linux/ unsigned long _skb_refdst; void (*destructor)(struct sk_buff *skb); -diff -aurN linux-4.14.41/include/linux/tcp.h mptcp-mptcp_v0.94/include/linux/tcp.h ---- linux-4.14.41/include/linux/tcp.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/linux/tcp.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/linux/tcp.h b/include/linux/tcp.h +--- a/include/linux/tcp.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/linux/tcp.h 2018-08-22 02:56:26.000000000 +0200 @@ -58,7 +58,7 @@ /* TCP Fast Open */ #define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */ @@ -203,9 +203,9 @@ diff -aurN linux-4.14.41/include/linux/tcp.h mptcp-mptcp_v0.94/include/linux/tcp }; static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) -diff -aurN linux-4.14.41/include/net/inet_common.h mptcp-mptcp_v0.94/include/net/inet_common.h ---- linux-4.14.41/include/net/inet_common.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/net/inet_common.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/inet_common.h b/include/net/inet_common.h +--- a/include/net/inet_common.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/net/inet_common.h 2018-08-22 02:56:26.000000000 +0200 @@ -2,6 +2,8 @@ #ifndef _INET_COMMON_H #define _INET_COMMON_H @@ -224,9 +224,9 @@ diff -aurN linux-4.14.41/include/net/inet_common.h mptcp-mptcp_v0.94/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-4.14.41/include/net/inet_connection_sock.h mptcp-mptcp_v0.94/include/net/inet_connection_sock.h ---- linux-4.14.41/include/net/inet_connection_sock.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/net/inet_connection_sock.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h +--- a/include/net/inet_connection_sock.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/net/inet_connection_sock.h 2018-08-22 02:56:26.000000000 +0200 @@ -30,6 +30,7 @@ struct inet_bind_bucket; @@ -235,9 +235,9 @@ diff -aurN linux-4.14.41/include/net/inet_connection_sock.h mptcp-mptcp_v0.94/in /* * Pointers to address related TCP functions -diff -aurN linux-4.14.41/include/net/inet_sock.h mptcp-mptcp_v0.94/include/net/inet_sock.h ---- linux-4.14.41/include/net/inet_sock.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/net/inet_sock.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/inet_sock.h b/include/net/inet_sock.h +--- a/include/net/inet_sock.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/net/inet_sock.h 2018-08-22 02:56:26.000000000 +0200 @@ -90,7 +90,9 @@ wscale_ok : 1, ecn_ok : 1, @@ -249,10 +249,10 @@ diff -aurN linux-4.14.41/include/net/inet_sock.h mptcp-mptcp_v0.94/include/net/i u32 ir_mark; union { struct ip_options_rcu __rcu *ireq_opt; -diff -aurN linux-4.14.41/include/net/mptcp.h mptcp-mptcp_v0.94/include/net/mptcp.h ---- linux-4.14.41/include/net/mptcp.h 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/include/net/mptcp.h 2018-07-20 10:46:09.000000000 +0200 -@@ -0,0 +1,1508 @@ +diff -aurN a/include/net/mptcp.h b/include/net/mptcp.h +--- a/include/net/mptcp.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/include/net/mptcp.h 2018-08-22 02:56:26.000000000 +0200 +@@ -0,0 +1,1510 @@ +/* + * MPTCP implementation + * @@ -1089,6 +1089,7 @@ diff -aurN linux-4.14.41/include/net/mptcp.h mptcp-mptcp_v0.94/include/net/mptcp +void mptcp_sub_close(struct sock *sk, unsigned long delay); +struct sock *mptcp_select_ack_sock(const struct sock *meta_sk); +void mptcp_fallback_meta_sk(struct sock *meta_sk); ++void mptcp_prepare_for_backlog(struct sock *sk, struct sk_buff *skb); +int mptcp_backlog_rcv(struct sock *meta_sk, struct sk_buff *skb); +void mptcp_ack_handler(unsigned long); +bool mptcp_check_rtt(const struct tcp_sock *tp, int time); @@ -1693,6 +1694,7 @@ diff -aurN linux-4.14.41/include/net/mptcp.h mptcp-mptcp_v0.94/include/net/mptcp + return false; +} +static inline void mptcp_init_mp_opt(const struct mptcp_options_received *mopt) {} ++static inline void mptcp_prepare_for_backlog(struct sock *sk, struct sk_buff *skb) {} +static inline bool mptcp_check_rtt(const struct tcp_sock *tp, int time) +{ + return false; @@ -1761,9 +1763,9 @@ diff -aurN linux-4.14.41/include/net/mptcp.h mptcp-mptcp_v0.94/include/net/mptcp +#endif /* CONFIG_MPTCP */ + +#endif /* _MPTCP_H */ -diff -aurN linux-4.14.41/include/net/mptcp_v4.h mptcp-mptcp_v0.94/include/net/mptcp_v4.h ---- linux-4.14.41/include/net/mptcp_v4.h 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/include/net/mptcp_v4.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/mptcp_v4.h b/include/net/mptcp_v4.h +--- a/include/net/mptcp_v4.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/include/net/mptcp_v4.h 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,68 @@ +/* + * MPTCP implementation @@ -1833,9 +1835,9 @@ diff -aurN linux-4.14.41/include/net/mptcp_v4.h mptcp-mptcp_v0.94/include/net/mp +#endif /* CONFIG_MPTCP */ + +#endif /* MPTCP_V4_H_ */ -diff -aurN linux-4.14.41/include/net/mptcp_v6.h mptcp-mptcp_v0.94/include/net/mptcp_v6.h ---- linux-4.14.41/include/net/mptcp_v6.h 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/include/net/mptcp_v6.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/mptcp_v6.h b/include/net/mptcp_v6.h +--- a/include/net/mptcp_v6.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/include/net/mptcp_v6.h 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,69 @@ +/* + * MPTCP implementation @@ -1906,9 +1908,9 @@ diff -aurN linux-4.14.41/include/net/mptcp_v6.h mptcp-mptcp_v0.94/include/net/mp +#endif /* CONFIG_MPTCP */ + +#endif /* _MPTCP_V6_H */ -diff -aurN linux-4.14.41/include/net/net_namespace.h mptcp-mptcp_v0.94/include/net/net_namespace.h ---- linux-4.14.41/include/net/net_namespace.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/net/net_namespace.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/net_namespace.h b/include/net/net_namespace.h +--- a/include/net/net_namespace.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/net/net_namespace.h 2018-08-22 02:56:26.000000000 +0200 @@ -18,6 +18,7 @@ #include #include @@ -1927,9 +1929,9 @@ diff -aurN linux-4.14.41/include/net/net_namespace.h mptcp-mptcp_v0.94/include/n #if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN) struct netns_ieee802154_lowpan ieee802154_lowpan; #endif -diff -aurN linux-4.14.41/include/net/netns/mptcp.h mptcp-mptcp_v0.94/include/net/netns/mptcp.h ---- linux-4.14.41/include/net/netns/mptcp.h 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/include/net/netns/mptcp.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/netns/mptcp.h b/include/net/netns/mptcp.h +--- a/include/net/netns/mptcp.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/include/net/netns/mptcp.h 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,52 @@ +/* + * MPTCP implementation - MPTCP namespace @@ -1983,9 +1985,9 @@ diff -aurN linux-4.14.41/include/net/netns/mptcp.h mptcp-mptcp_v0.94/include/net +}; + +#endif /* __NETNS_MPTCP_H__ */ -diff -aurN linux-4.14.41/include/net/snmp.h mptcp-mptcp_v0.94/include/net/snmp.h ---- linux-4.14.41/include/net/snmp.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/net/snmp.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/snmp.h b/include/net/snmp.h +--- a/include/net/snmp.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/net/snmp.h 2018-08-22 02:56:26.000000000 +0200 @@ -91,7 +91,6 @@ atomic_long_t mibs[ICMP6MSG_MIB_MAX]; }; @@ -1994,9 +1996,9 @@ diff -aurN linux-4.14.41/include/net/snmp.h mptcp-mptcp_v0.94/include/net/snmp.h /* TCP */ #define TCP_MIB_MAX __TCP_MIB_MAX struct tcp_mib { -diff -aurN linux-4.14.41/include/net/sock.h mptcp-mptcp_v0.94/include/net/sock.h ---- linux-4.14.41/include/net/sock.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/net/sock.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/sock.h b/include/net/sock.h +--- a/include/net/sock.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/net/sock.h 2018-08-22 02:56:26.000000000 +0200 @@ -771,6 +771,7 @@ SOCK_FILTER_LOCKED, /* Filter cannot be changed anymore */ SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */ @@ -2013,9 +2015,9 @@ diff -aurN linux-4.14.41/include/net/sock.h mptcp-mptcp_v0.94/include/net/sock.h /* Keeping track of sockets in use */ #ifdef CONFIG_PROC_FS -diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h ---- linux-4.14.41/include/net/tcp.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/net/tcp.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/tcp.h b/include/net/tcp.h +--- a/include/net/tcp.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/net/tcp.h 2018-08-22 02:56:26.000000000 +0200 @@ -185,6 +185,7 @@ #define TCPOPT_SACK 5 /* SACK Block */ #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ @@ -2152,7 +2154,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h void tcp_tasklet_init(void); void tcp_v4_err(struct sk_buff *skb, u32); -@@ -433,7 +549,9 @@ +@@ -434,7 +549,9 @@ int flags, int *addr_len); void tcp_parse_options(const struct net *net, const struct sk_buff *skb, struct tcp_options_received *opt_rx, @@ -2163,7 +2165,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); /* -@@ -442,6 +560,7 @@ +@@ -443,6 +560,7 @@ void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb); void tcp_v4_mtu_reduced(struct sock *sk); @@ -2171,7 +2173,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/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, -@@ -522,7 +641,8 @@ +@@ -523,7 +641,8 @@ u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, u16 *mssp); @@ -2181,7 +2183,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/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); -@@ -536,7 +656,8 @@ +@@ -537,7 +656,8 @@ u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, const struct tcphdr *th, u16 *mssp); @@ -2191,7 +2193,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h #endif /* tcp_output.c */ -@@ -567,10 +688,17 @@ +@@ -569,10 +689,17 @@ void tcp_skb_collapse_tstamp(struct sk_buff *skb, const struct sk_buff *next_skb); @@ -2209,7 +2211,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/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); -@@ -803,6 +931,12 @@ +@@ -805,6 +932,12 @@ */ ktime_t swtstamp; }; @@ -2222,7 +2224,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ __u8 sacked; /* State flags for SACK/FACK. */ -@@ -821,6 +955,14 @@ +@@ -823,6 +956,14 @@ has_rxtstamp:1, /* SKB has a RX timestamp */ unused:5; __u32 ack_seq; /* Sequence number ACK'd */ @@ -2237,7 +2239,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h union { struct { /* There is space for up to 24 bytes */ -@@ -1319,7 +1461,8 @@ +@@ -1326,7 +1467,8 @@ /* Determine a window scaling and initial window to offer. */ void tcp_select_initial_window(int __space, __u32 mss, __u32 *rcv_wnd, __u32 *window_clamp, int wscale_ok, @@ -2247,7 +2249,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h static inline int tcp_win_from_space(int space) { -@@ -1330,6 +1473,19 @@ +@@ -1337,6 +1479,19 @@ space - (space>>tcp_adv_win_scale); } @@ -2267,7 +2269,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h /* Note: caller must be prepared to deal with negative returns */ static inline int tcp_space(const struct sock *sk) { -@@ -1880,6 +2036,30 @@ +@@ -1887,6 +2042,30 @@ #endif }; @@ -2298,7 +2300,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h struct tcp_request_sock_ops { u16 mss_clamp; #ifdef CONFIG_TCP_MD5SIG -@@ -1890,12 +2070,13 @@ +@@ -1897,12 +2076,13 @@ const struct sock *sk, const struct sk_buff *skb); #endif @@ -2317,7 +2319,7 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h #endif struct dst_entry *(*route_req)(const struct sock *sk, struct flowi *fl, const struct request_sock *req); -@@ -1909,15 +2090,17 @@ +@@ -1916,15 +2096,17 @@ #ifdef CONFIG_SYN_COOKIES static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops, @@ -2336,9 +2338,9 @@ diff -aurN linux-4.14.41/include/net/tcp.h mptcp-mptcp_v0.94/include/net/tcp.h const struct sock *sk, struct sk_buff *skb, __u16 *mss) { -diff -aurN linux-4.14.41/include/net/tcp_states.h mptcp-mptcp_v0.94/include/net/tcp_states.h ---- linux-4.14.41/include/net/tcp_states.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/net/tcp_states.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/net/tcp_states.h b/include/net/tcp_states.h +--- a/include/net/tcp_states.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/net/tcp_states.h 2018-08-22 02:56:26.000000000 +0200 @@ -26,6 +26,7 @@ TCP_LISTEN, TCP_CLOSING, /* Now a valid state */ @@ -2355,10 +2357,10 @@ diff -aurN linux-4.14.41/include/net/tcp_states.h mptcp-mptcp_v0.94/include/net/ }; #endif /* _LINUX_TCP_STATES_H */ -diff -aurN linux-4.14.41/include/net/transp_v6.h mptcp-mptcp_v0.94/include/net/transp_v6.h ---- linux-4.14.41/include/net/transp_v6.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/net/transp_v6.h 2018-07-20 10:46:09.000000000 +0200 -@@ -52,6 +52,8 @@ +diff -aurN a/include/net/transp_v6.h b/include/net/transp_v6.h +--- a/include/net/transp_v6.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/net/transp_v6.h 2018-08-22 02:56:26.000000000 +0200 +@@ -59,6 +59,8 @@ /* address family specific functions */ extern const struct inet_connection_sock_af_ops ipv4_specific; @@ -2367,9 +2369,9 @@ diff -aurN linux-4.14.41/include/net/transp_v6.h mptcp-mptcp_v0.94/include/net/t void inet6_destroy_sock(struct sock *sk); -diff -aurN linux-4.14.41/include/uapi/linux/if.h mptcp-mptcp_v0.94/include/uapi/linux/if.h ---- linux-4.14.41/include/uapi/linux/if.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/uapi/linux/if.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/uapi/linux/if.h b/include/uapi/linux/if.h +--- a/include/uapi/linux/if.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/uapi/linux/if.h 2018-08-22 02:56:26.000000000 +0200 @@ -132,6 +132,9 @@ #define IFF_ECHO IFF_ECHO #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ @@ -2380,9 +2382,9 @@ diff -aurN linux-4.14.41/include/uapi/linux/if.h mptcp-mptcp_v0.94/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-4.14.41/include/uapi/linux/tcp.h mptcp-mptcp_v0.94/include/uapi/linux/tcp.h ---- linux-4.14.41/include/uapi/linux/tcp.h 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/include/uapi/linux/tcp.h 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h +--- a/include/uapi/linux/tcp.h 2018-08-17 21:01:12.000000000 +0200 ++++ b/include/uapi/linux/tcp.h 2018-08-22 02:56:26.000000000 +0200 @@ -18,9 +18,15 @@ #ifndef _UAPI_LINUX_TCP_H #define _UAPI_LINUX_TCP_H @@ -2467,9 +2469,9 @@ diff -aurN linux-4.14.41/include/uapi/linux/tcp.h mptcp-mptcp_v0.94/include/uapi /* for TCP_MD5SIG socket option */ #define TCP_MD5SIG_MAXKEYLEN 80 -diff -aurN linux-4.14.41/net/core/dev.c mptcp-mptcp_v0.94/net/core/dev.c ---- linux-4.14.41/net/core/dev.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/core/dev.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/core/dev.c b/net/core/dev.c +--- a/net/core/dev.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/core/dev.c 2018-08-22 02:56:26.000000000 +0200 @@ -6740,7 +6740,7 @@ dev->flags = (flags & (IFF_DEBUG | IFF_NOTRAILERS | IFF_NOARP | @@ -2479,9 +2481,9 @@ diff -aurN linux-4.14.41/net/core/dev.c mptcp-mptcp_v0.94/net/core/dev.c (dev->flags & (IFF_UP | IFF_VOLATILE | IFF_PROMISC | IFF_ALLMULTI)); -diff -aurN linux-4.14.41/net/core/skbuff.c mptcp-mptcp_v0.94/net/core/skbuff.c ---- linux-4.14.41/net/core/skbuff.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/core/skbuff.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/core/skbuff.c b/net/core/skbuff.c +--- a/net/core/skbuff.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/core/skbuff.c 2018-08-22 02:56:26.000000000 +0200 @@ -532,7 +532,7 @@ skb_drop_list(&skb_shinfo(skb)->frag_list); } @@ -2491,7 +2493,7 @@ diff -aurN linux-4.14.41/net/core/skbuff.c mptcp-mptcp_v0.94/net/core/skbuff.c { struct sk_buff *list; -@@ -1303,7 +1303,7 @@ +@@ -1304,7 +1304,7 @@ skb->inner_mac_header += off; } @@ -2500,9 +2502,9 @@ diff -aurN linux-4.14.41/net/core/skbuff.c mptcp-mptcp_v0.94/net/core/skbuff.c { __copy_skb_header(new, old); -diff -aurN linux-4.14.41/net/core/sock.c mptcp-mptcp_v0.94/net/core/sock.c ---- linux-4.14.41/net/core/sock.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/core/sock.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/core/sock.c b/net/core/sock.c +--- a/net/core/sock.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/core/sock.c 2018-08-22 02:56:26.000000000 +0200 @@ -139,6 +139,11 @@ #include @@ -2562,9 +2564,9 @@ diff -aurN linux-4.14.41/net/core/sock.c mptcp-mptcp_v0.94/net/core/sock.c mem_cgroup_sk_alloc(newsk); cgroup_sk_alloc(&newsk->sk_cgrp_data); -diff -aurN linux-4.14.41/net/ipv4/af_inet.c mptcp-mptcp_v0.94/net/ipv4/af_inet.c ---- linux-4.14.41/net/ipv4/af_inet.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/af_inet.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c +--- a/net/ipv4/af_inet.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/af_inet.c 2018-08-22 02:56:26.000000000 +0200 @@ -104,6 +104,7 @@ #include #include @@ -2627,9 +2629,9 @@ diff -aurN linux-4.14.41/net/ipv4/af_inet.c mptcp-mptcp_v0.94/net/ipv4/af_inet.c /* Setup TCP slab cache for open requests. */ tcp_init(); -diff -aurN linux-4.14.41/net/ipv4/inet_connection_sock.c mptcp-mptcp_v0.94/net/ipv4/inet_connection_sock.c ---- linux-4.14.41/net/ipv4/inet_connection_sock.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/inet_connection_sock.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c +--- a/net/ipv4/inet_connection_sock.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/inet_connection_sock.c 2018-08-22 02:56:26.000000000 +0200 @@ -23,6 +23,7 @@ #include #include @@ -2683,9 +2685,9 @@ diff -aurN linux-4.14.41/net/ipv4/inet_connection_sock.c mptcp-mptcp_v0.94/net/i sock_put(child); cond_resched(); -diff -aurN linux-4.14.41/net/ipv4/ip_sockglue.c mptcp-mptcp_v0.94/net/ipv4/ip_sockglue.c ---- linux-4.14.41/net/ipv4/ip_sockglue.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/ip_sockglue.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c +--- a/net/ipv4/ip_sockglue.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/ip_sockglue.c 2018-08-22 02:56:26.000000000 +0200 @@ -44,6 +44,8 @@ #endif #include @@ -2695,7 +2697,7 @@ diff -aurN linux-4.14.41/net/ipv4/ip_sockglue.c mptcp-mptcp_v0.94/net/ipv4/ip_so #include #include -@@ -754,6 +756,17 @@ +@@ -755,6 +757,17 @@ inet->tos = val; sk->sk_priority = rt_tos2priority(val); sk_dst_reset(sk); @@ -2713,9 +2715,9 @@ diff -aurN linux-4.14.41/net/ipv4/ip_sockglue.c mptcp-mptcp_v0.94/net/ipv4/ip_so } break; case IP_TTL: -diff -aurN linux-4.14.41/net/ipv4/Kconfig mptcp-mptcp_v0.94/net/ipv4/Kconfig ---- linux-4.14.41/net/ipv4/Kconfig 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/Kconfig 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/Kconfig b/net/ipv4/Kconfig +--- a/net/ipv4/Kconfig 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/Kconfig 2018-08-22 02:56:26.000000000 +0200 @@ -675,6 +675,38 @@ bufferbloat, policers, or AQM schemes that do not provide a delay signal. It requires the fq ("Fair Queue") pacing packet scheduler. @@ -2785,9 +2787,9 @@ diff -aurN linux-4.14.41/net/ipv4/Kconfig mptcp-mptcp_v0.94/net/ipv4/Kconfig default "reno" if DEFAULT_RENO default "dctcp" if DEFAULT_DCTCP default "cdg" if DEFAULT_CDG -diff -aurN linux-4.14.41/net/ipv4/syncookies.c mptcp-mptcp_v0.94/net/ipv4/syncookies.c ---- linux-4.14.41/net/ipv4/syncookies.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/syncookies.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c +--- a/net/ipv4/syncookies.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/syncookies.c 2018-08-22 02:56:26.000000000 +0200 @@ -16,6 +16,8 @@ #include #include @@ -2900,9 +2902,9 @@ diff -aurN linux-4.14.41/net/ipv4/syncookies.c mptcp-mptcp_v0.94/net/ipv4/syncoo ireq->rcv_wscale = rcv_wscale; ireq->ecn_ok = cookie_ecn_ok(&tcp_opt, sock_net(sk), &rt->dst); -diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c ---- linux-4.14.41/net/ipv4/tcp.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/tcp.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/tcp.c b/net/ipv4/tcp.c +--- a/net/ipv4/tcp.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/tcp.c 2018-08-22 02:56:26.000000000 +0200 @@ -273,6 +273,7 @@ #include @@ -3053,7 +3055,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c { const struct tcp_sock *tp = tcp_sk(sk); int tmp = tp->mss_cache; -@@ -1211,12 +1269,19 @@ +@@ -1212,12 +1270,19 @@ * is fully established. */ if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) && @@ -3074,7 +3076,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c if (unlikely(tp->repair)) { if (tp->repair_queue == TCP_RECV_QUEUE) { copied = tcp_send_rcvq(sk, msg, size); -@@ -1252,7 +1317,10 @@ +@@ -1253,7 +1318,10 @@ if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN)) goto do_error; @@ -3086,7 +3088,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c while (msg_data_left(msg)) { int copy = 0; -@@ -1281,7 +1349,7 @@ +@@ -1282,7 +1350,7 @@ } first_skb = skb_queue_empty(&sk->sk_write_queue); skb = sk_stream_alloc_skb(sk, @@ -3095,7 +3097,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c sk->sk_allocation, first_skb); if (!skb) -@@ -1290,8 +1358,15 @@ +@@ -1291,8 +1359,15 @@ process_backlog = true; /* * Check whether we can use HW checksum. @@ -3112,7 +3114,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c skb->ip_summed = CHECKSUM_PARTIAL; skb_entail(sk, skb); -@@ -1522,7 +1597,7 @@ +@@ -1523,7 +1598,7 @@ * calculation of whether or not we must ACK for the sake of * a window update. */ @@ -3121,7 +3123,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c { struct tcp_sock *tp = tcp_sk(sk); bool time_to_ack = false; -@@ -1565,7 +1640,7 @@ +@@ -1566,7 +1641,7 @@ /* Optimize, __tcp_select_window() is not cheap. */ if (2*rcv_window_now <= tp->window_clamp) { @@ -3130,7 +3132,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c /* Send ACK now, if this read freed lots of space * in our buffer. Certainly, new_window is new window. -@@ -1681,7 +1756,7 @@ +@@ -1682,7 +1757,7 @@ /* Clean up data we have read: This will do ACK frames. */ if (copied > 0) { tcp_recv_skb(sk, seq, &offset); @@ -3139,7 +3141,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c } return copied; } -@@ -1781,6 +1856,14 @@ +@@ -1782,6 +1857,14 @@ lock_sock(sk); @@ -3154,7 +3156,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c err = -ENOTCONN; if (sk->sk_state == TCP_LISTEN) goto out; -@@ -1901,7 +1984,7 @@ +@@ -1902,7 +1985,7 @@ } } @@ -3163,7 +3165,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c if (copied >= target) { /* Do not sleep, just process backlog. */ -@@ -1994,7 +2077,7 @@ +@@ -1995,7 +2078,7 @@ tcp_recv_timestamp(msg, sk, &tss); /* Clean up data we have read: This will do ACK frames. */ @@ -3172,7 +3174,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c release_sock(sk); return copied; -@@ -2072,7 +2155,7 @@ +@@ -2073,7 +2156,7 @@ [TCP_NEW_SYN_RECV] = TCP_CLOSE, /* should not happen ! */ }; @@ -3181,7 +3183,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c { int next = (int)new_state[sk->sk_state]; int ns = next & TCP_STATE_MASK; -@@ -2102,7 +2185,7 @@ +@@ -2103,7 +2186,7 @@ TCPF_SYN_RECV | TCPF_CLOSE_WAIT)) { /* Clear out any half completed packets. FIN if needed. */ if (tcp_close_state(sk)) @@ -3190,7 +3192,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c } } EXPORT_SYMBOL(tcp_shutdown); -@@ -2127,6 +2210,11 @@ +@@ -2128,6 +2211,11 @@ int data_was_unread = 0; int state; @@ -3202,7 +3204,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c lock_sock(sk); sk->sk_shutdown = SHUTDOWN_MASK; -@@ -2171,7 +2259,7 @@ +@@ -2172,7 +2260,7 @@ /* Unread data was tossed, zap the connection. */ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONCLOSE); tcp_set_state(sk, TCP_CLOSE); @@ -3211,7 +3213,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/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); -@@ -2251,7 +2339,7 @@ +@@ -2252,7 +2340,7 @@ struct tcp_sock *tp = tcp_sk(sk); if (tp->linger2 < 0) { tcp_set_state(sk, TCP_CLOSE); @@ -3220,7 +3222,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONLINGER); } else { -@@ -2261,7 +2349,8 @@ +@@ -2262,7 +2350,8 @@ inet_csk_reset_keepalive_timer(sk, tmo - TCP_TIMEWAIT_LEN); } else { @@ -3230,7 +3232,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c goto out; } } -@@ -2270,7 +2359,7 @@ +@@ -2271,7 +2360,7 @@ sk_mem_reclaim(sk); if (tcp_check_oom(sk, 0)) { tcp_set_state(sk, TCP_CLOSE); @@ -3239,7 +3241,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY); } else if (!check_net(sock_net(sk))) { -@@ -2298,15 +2387,6 @@ +@@ -2299,15 +2388,6 @@ } EXPORT_SYMBOL(tcp_close); @@ -3255,7 +3257,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c int tcp_disconnect(struct sock *sk, int flags) { struct inet_sock *inet = inet_sk(sk); -@@ -2329,7 +2409,7 @@ +@@ -2330,7 +2410,7 @@ /* The last check adjusts for discrepancy of Linux wrt. RFC * states */ @@ -3264,7 +3266,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c sk->sk_err = ECONNRESET; } else if (old_state == TCP_SYN_SENT) sk->sk_err = ECONNRESET; -@@ -2345,6 +2425,13 @@ +@@ -2346,6 +2426,13 @@ if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK)) inet_reset_saddr(sk); @@ -3278,7 +3280,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c sk->sk_shutdown = 0; sock_reset_flag(sk, SOCK_DONE); tp->srtt_us = 0; -@@ -2527,6 +2614,61 @@ +@@ -2528,6 +2615,61 @@ release_sock(sk); return err; } @@ -3340,7 +3342,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c default: /* fallthru */ break; -@@ -2704,6 +2846,12 @@ +@@ -2705,6 +2847,12 @@ break; case TCP_DEFER_ACCEPT: @@ -3353,7 +3355,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/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, -@@ -2731,7 +2879,7 @@ +@@ -2732,7 +2880,7 @@ (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT) && inet_csk_ack_scheduled(sk)) { icsk->icsk_ack.pending |= ICSK_ACK_PUSHED; @@ -3362,7 +3364,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c if (!(val & 1)) icsk->icsk_ack.pingpong = 1; } -@@ -2792,6 +2940,28 @@ +@@ -2793,6 +2941,28 @@ tp->notsent_lowat = val; sk->sk_write_space(sk); break; @@ -3391,7 +3393,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c default: err = -ENOPROTOOPT; break; -@@ -3219,6 +3389,75 @@ +@@ -3220,6 +3390,75 @@ } return 0; } @@ -3467,7 +3469,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c default: return -ENOPROTOOPT; } -@@ -3393,7 +3632,9 @@ +@@ -3394,7 +3633,9 @@ if (sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV) TCP_INC_STATS(sock_net(sk), TCP_MIB_ATTEMPTFAILS); @@ -3477,7 +3479,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c tcp_clear_xmit_timers(sk); if (req) reqsk_fastopen_remove(sk, req, false); -@@ -3409,6 +3650,8 @@ +@@ -3410,6 +3651,8 @@ int tcp_abort(struct sock *sk, int err) { @@ -3517,9 +3519,9 @@ diff -aurN linux-4.14.41/net/ipv4/tcp.c mptcp-mptcp_v0.94/net/ipv4/tcp.c return 0; } EXPORT_SYMBOL_GPL(tcp_abort); -diff -aurN linux-4.14.41/net/ipv4/tcp_fastopen.c mptcp-mptcp_v0.94/net/ipv4/tcp_fastopen.c ---- linux-4.14.41/net/ipv4/tcp_fastopen.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/tcp_fastopen.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c +--- a/net/ipv4/tcp_fastopen.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/tcp_fastopen.c 2018-08-22 02:56:26.000000000 +0200 @@ -9,6 +9,7 @@ #include #include @@ -3572,9 +3574,9 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_fastopen.c mptcp-mptcp_v0.94/net/ipv4/tcp_ /* tcp_conn_request() is sending the SYNACK, * and queues the child into listener accept queue. */ -diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_input.c ---- linux-4.14.41/net/ipv4/tcp_input.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/tcp_input.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c +--- a/net/ipv4/tcp_input.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/tcp_input.c 2018-08-22 02:56:26.000000000 +0200 @@ -76,6 +76,9 @@ #include #include @@ -3614,7 +3616,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/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)) -@@ -324,8 +305,12 @@ +@@ -329,8 +310,12 @@ per_mss = roundup_pow_of_two(per_mss) + SKB_DATA_ALIGN(sizeof(struct sk_buff)); @@ -3629,7 +3631,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp /* Fast Recovery (RFC 5681 3.2) : * Cubic needs 1.7 factor, rounded to 2 to include -@@ -334,8 +319,16 @@ +@@ -339,8 +324,16 @@ sndmem = ca_ops->sndbuf_expand ? ca_ops->sndbuf_expand(sk) : 2; sndmem *= nr_segs * per_mss; @@ -3647,7 +3649,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp } /* 2. Tuning advertised window (window_clamp, rcv_ssthresh) -@@ -384,10 +377,15 @@ +@@ -389,10 +382,15 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) { struct tcp_sock *tp = tcp_sk(sk); @@ -3665,7 +3667,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp !tcp_under_memory_pressure(sk)) { int incr; -@@ -395,14 +393,14 @@ +@@ -400,14 +398,14 @@ * will fit to rcvbuf in future. */ if (tcp_win_from_space(skb->truesize) <= skb->len) @@ -3684,7 +3686,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp inet_csk(sk)->icsk_ack.quick |= 1; } } -@@ -596,7 +594,10 @@ +@@ -601,7 +599,10 @@ tcp_mstamp_refresh(tp); time = tcp_stamp_us_delta(tp->tcp_mstamp, tp->rcvq_space.time); @@ -3696,7 +3698,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp return; /* Number of bytes copied to user in last RTT */ -@@ -830,7 +831,7 @@ +@@ -837,7 +838,7 @@ /* Calculate rto without backoff. This is the second half of Van Jacobson's * routine referred to above. */ @@ -3705,7 +3707,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { const struct tcp_sock *tp = tcp_sk(sk); /* Old crap is replaced with new one. 8) -@@ -1404,7 +1405,11 @@ +@@ -1411,7 +1412,11 @@ int len; int in_sack; @@ -3718,7 +3720,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp goto fallback; /* Normally R but no L won't result in plain S */ -@@ -2956,7 +2961,7 @@ +@@ -2963,7 +2968,7 @@ */ tcp_update_rtt_min(sk, ca_rtt_us); tcp_rtt_estimator(sk, seq_rtt_us); @@ -3727,7 +3729,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp /* RFC6298: only reset backoff on valid RTT measurement. */ inet_csk(sk)->icsk_backoff = 0; -@@ -3024,7 +3029,7 @@ +@@ -3031,7 +3036,7 @@ } /* If we get here, the whole TSO packet has not been acked. */ @@ -3736,7 +3738,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { struct tcp_sock *tp = tcp_sk(sk); u32 packets_acked; -@@ -3147,6 +3152,8 @@ +@@ -3154,6 +3159,8 @@ */ if (likely(!(scb->tcp_flags & TCPHDR_SYN))) { flag |= FLAG_DATA_ACKED; @@ -3745,7 +3747,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp } else { flag |= FLAG_SYN_ACKED; tp->retrans_stamp = 0; -@@ -3250,7 +3257,7 @@ +@@ -3266,7 +3273,7 @@ return flag; } @@ -3754,7 +3756,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { const struct tcp_sock *tp = tcp_sk(sk); struct inet_connection_sock *icsk = inet_csk(sk); -@@ -3320,9 +3327,8 @@ +@@ -3336,9 +3343,8 @@ /* Check that window update is acceptable. * The function assumes that snd_una<=ack<=snd_next. */ @@ -3766,7 +3768,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { return after(ack, tp->snd_una) || after(ack_seq, tp->snd_wl1) || -@@ -3542,7 +3548,7 @@ +@@ -3558,7 +3564,7 @@ } /* This routine deals with incoming acks, but not outgoing ones. */ @@ -3775,7 +3777,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); -@@ -3649,6 +3655,16 @@ +@@ -3665,6 +3671,16 @@ flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una, &acked, &sack_state); @@ -3792,7 +3794,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (tp->tlp_high_seq) tcp_process_tlp_ack(sk, ack, flag); /* If needed, reset TLP/RTO timer; RACK may later override this. */ -@@ -3727,8 +3743,10 @@ +@@ -3743,8 +3759,10 @@ */ void tcp_parse_options(const struct net *net, const struct sk_buff *skb, @@ -3805,7 +3807,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { const unsigned char *ptr; const struct tcphdr *th = tcp_hdr(skb); -@@ -3812,6 +3830,10 @@ +@@ -3828,6 +3846,10 @@ */ break; #endif @@ -3816,7 +3818,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp case TCPOPT_FASTOPEN: tcp_parse_fastopen_option( opsize - TCPOLEN_FASTOPEN_BASE, -@@ -3876,7 +3898,9 @@ +@@ -3892,7 +3914,9 @@ return true; } @@ -3827,7 +3829,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) tp->rx_opt.rcv_tsecr -= tp->tsoffset; -@@ -4033,6 +4057,11 @@ +@@ -4049,6 +4073,11 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -3839,7 +3841,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp inet_csk_schedule_ack(sk); sk->sk_shutdown |= RCV_SHUTDOWN; -@@ -4043,6 +4072,10 @@ +@@ -4059,6 +4088,10 @@ case TCP_ESTABLISHED: /* Move to CLOSE_WAIT */ tcp_set_state(sk, TCP_CLOSE_WAIT); @@ -3850,7 +3852,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp inet_csk(sk)->icsk_ack.pingpong = 1; break; -@@ -4065,9 +4098,16 @@ +@@ -4081,9 +4114,16 @@ tcp_set_state(sk, TCP_CLOSING); break; case TCP_FIN_WAIT2: @@ -3868,7 +3870,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp break; default: /* Only TCP_LISTEN and TCP_CLOSE are left, in these -@@ -4089,6 +4129,10 @@ +@@ -4105,6 +4145,10 @@ if (!sock_flag(sk, SOCK_DEAD)) { sk->sk_state_change(sk); @@ -3879,7 +3881,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp /* Do not send POLL_HUP for half duplex close. */ if (sk->sk_shutdown == SHUTDOWN_MASK || sk->sk_state == TCP_CLOSE) -@@ -4295,6 +4339,9 @@ +@@ -4311,6 +4355,9 @@ *fragstolen = false; @@ -3889,7 +3891,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/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; -@@ -4329,7 +4376,7 @@ +@@ -4362,7 +4409,7 @@ /* This one checks to see if we can put data from the * out_of_order queue into the receive_queue. */ @@ -3898,7 +3900,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { struct tcp_sock *tp = tcp_sk(sk); __u32 dsack_high = tp->rcv_nxt; -@@ -4355,7 +4402,14 @@ +@@ -4388,7 +4435,14 @@ if (TCP_SKB_CB(skb)->has_rxtstamp) skb->tstamp = TCP_SKB_CB(skb)->swtstamp; @@ -3914,7 +3916,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp SOCK_DEBUG(sk, "ofo packet was already received\n"); tcp_drop(sk, skb); continue; -@@ -4390,6 +4444,9 @@ +@@ -4423,6 +4477,9 @@ static int tcp_try_rmem_schedule(struct sock *sk, struct sk_buff *skb, unsigned int size) { @@ -3924,7 +3926,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || !sk_rmem_schedule(sk, skb, size)) { -@@ -4404,7 +4461,7 @@ +@@ -4437,7 +4494,7 @@ return 0; } @@ -3933,7 +3935,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { struct tcp_sock *tp = tcp_sk(sk); struct rb_node **p, *q, *parent; -@@ -4476,7 +4533,8 @@ +@@ -4509,7 +4566,8 @@ continue; } if (before(seq, TCP_SKB_CB(skb1)->end_seq)) { @@ -3943,7 +3945,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp /* All the bits are present. Drop. */ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOMERGE); -@@ -4525,6 +4583,11 @@ +@@ -4558,6 +4616,11 @@ end_seq); break; } @@ -3955,7 +3957,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/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); -@@ -4536,7 +4599,7 @@ +@@ -4569,7 +4632,7 @@ tp->ooo_last_skb = skb; add_sack: @@ -3964,7 +3966,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp tcp_sack_new_ofo_skb(sk, seq, end_seq); end: if (skb) { -@@ -4546,8 +4609,8 @@ +@@ -4579,8 +4642,8 @@ } } @@ -3975,7 +3977,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { int eaten; struct sk_buff *tail = skb_peek_tail(&sk->sk_receive_queue); -@@ -4620,10 +4683,14 @@ +@@ -4653,10 +4716,14 @@ bool fragstolen; int eaten; @@ -3991,7 +3993,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp skb_dst_drop(skb); __skb_pull(skb, tcp_hdr(skb)->doff * 4); -@@ -4648,7 +4715,7 @@ +@@ -4681,7 +4748,7 @@ eaten = tcp_queue_rcv(sk, skb, 0, &fragstolen); tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq); @@ -4000,7 +4002,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp tcp_event_data_recv(sk, skb); if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) tcp_fin(sk); -@@ -4670,7 +4737,11 @@ +@@ -4703,7 +4770,11 @@ if (eaten > 0) kfree_skb_partial(skb, fragstolen); @@ -4013,7 +4015,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp sk->sk_data_ready(sk); return; } -@@ -4997,7 +5068,7 @@ +@@ -5049,7 +5120,7 @@ return -1; } @@ -4022,7 +4024,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { const struct tcp_sock *tp = tcp_sk(sk); -@@ -5032,7 +5103,7 @@ +@@ -5084,7 +5155,7 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -4031,7 +4033,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp tcp_sndbuf_expand(sk); tp->snd_cwnd_stamp = tcp_jiffies32; } -@@ -5046,10 +5117,11 @@ +@@ -5098,10 +5169,11 @@ sock_reset_flag(sk, SOCK_QUEUE_SHRUNK); /* pairs with tcp_poll() */ smp_mb(); @@ -4046,7 +4048,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED); } } -@@ -5073,7 +5145,7 @@ +@@ -5125,7 +5197,7 @@ /* ... and right edge of window advances far enough. * (tcp_recvmsg() will send ACK otherwise). Or... */ @@ -4055,7 +4057,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp /* We ACK each frame or... */ tcp_in_quickack_mode(sk) || /* We have out of order data. */ -@@ -5175,6 +5247,10 @@ +@@ -5227,6 +5299,10 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -4066,7 +4068,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp /* Check if we get a new urgent pointer - normally not. */ if (th->urg) tcp_check_urg(sk, th); -@@ -5317,9 +5393,15 @@ +@@ -5369,9 +5445,15 @@ goto discard; } @@ -4082,7 +4084,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp tcp_drop(sk, skb); return false; } -@@ -5373,6 +5455,10 @@ +@@ -5425,6 +5507,10 @@ tp->rx_opt.saw_tstamp = 0; @@ -4093,7 +4095,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/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 -@@ -5542,7 +5628,7 @@ +@@ -5594,7 +5680,7 @@ */ tp->lsndtime = tcp_jiffies32; @@ -4102,7 +4104,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (sock_flag(sk, SOCK_KEEPOPEN)) inet_csk_reset_keepalive_timer(sk, keepalive_time_when(tp)); -@@ -5557,7 +5643,8 @@ +@@ -5609,7 +5695,8 @@ struct tcp_fastopen_cookie *cookie) { struct tcp_sock *tp = tcp_sk(sk); @@ -4112,7 +4114,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp u16 mss = tp->rx_opt.mss_clamp, try_exp = 0; bool syn_drop = false; -@@ -5567,7 +5654,7 @@ +@@ -5619,7 +5706,7 @@ /* Get original SYNACK MSS value if user MSS sets mss_clamp */ tcp_clear_options(&opt); opt.user_mss = opt.mss_clamp = 0; @@ -4121,7 +4123,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp mss = opt.mss_clamp; } -@@ -5591,7 +5678,11 @@ +@@ -5643,7 +5730,11 @@ tcp_fastopen_cache_set(sk, mss, cookie, syn_drop, try_exp); @@ -4134,7 +4136,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp tcp_for_write_queue_from(data, sk) { if (data == tcp_send_head(sk) || __tcp_retransmit_skb(sk, data, 1)) -@@ -5619,9 +5710,13 @@ +@@ -5671,9 +5762,13 @@ struct tcp_sock *tp = tcp_sk(sk); struct tcp_fastopen_cookie foc = { .len = -1 }; int saved_clamp = tp->rx_opt.mss_clamp; @@ -4149,7 +4151,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) tp->rx_opt.rcv_tsecr -= tp->tsoffset; -@@ -5681,6 +5776,30 @@ +@@ -5733,6 +5828,30 @@ tcp_init_wl(tp, TCP_SKB_CB(skb)->seq); tcp_ack(sk, skb, FLAG_SLOWPATH); @@ -4180,7 +4182,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp /* Ok.. it's good. Set up sequence numbers and * move to established. */ -@@ -5707,6 +5826,11 @@ +@@ -5759,6 +5878,11 @@ tp->tcp_header_len = sizeof(struct tcphdr); } @@ -4192,7 +4194,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (tcp_is_sack(tp) && sysctl_tcp_fack) tcp_enable_fack(tp); -@@ -5732,9 +5856,12 @@ +@@ -5784,9 +5908,12 @@ } if (fastopen_fail) return -1; @@ -4207,7 +4209,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp /* Save one ACK. Data will be ready after * several ticks, if write_pending is set. * -@@ -5773,6 +5900,7 @@ +@@ -5825,6 +5952,7 @@ tcp_paws_reject(&tp->rx_opt, 0)) goto discard_and_undo; @@ -4215,7 +4217,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (th->syn) { /* We see SYN without ACK. It is attempt of * simultaneous connect with crossed SYNs. -@@ -5789,6 +5917,11 @@ +@@ -5841,6 +5969,11 @@ tp->tcp_header_len = sizeof(struct tcphdr); } @@ -4227,7 +4229,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp tp->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; tp->copied_seq = tp->rcv_nxt; tp->rcv_wup = TCP_SKB_CB(skb)->seq + 1; -@@ -5847,6 +5980,7 @@ +@@ -5899,6 +6032,7 @@ */ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) @@ -4235,7 +4237,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp { struct tcp_sock *tp = tcp_sk(sk); struct inet_connection_sock *icsk = inet_csk(sk); -@@ -5887,6 +6021,16 @@ +@@ -5939,6 +6073,16 @@ tp->rx_opt.saw_tstamp = 0; tcp_mstamp_refresh(tp); queued = tcp_rcv_synsent_state_process(sk, skb, th); @@ -4252,7 +4254,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (queued >= 0) return queued; -@@ -5894,6 +6038,8 @@ +@@ -5946,6 +6090,8 @@ tcp_urg(sk, skb, th); __kfree_skb(skb); tcp_data_snd_check(sk); @@ -4261,7 +4263,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp return 0; } -@@ -5944,7 +6090,7 @@ +@@ -5996,7 +6142,7 @@ tcp_mtup_init(sk); tp->copied_seq = tp->rcv_nxt; @@ -4270,7 +4272,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp } smp_mb(); tcp_set_state(sk, TCP_ESTABLISHED); -@@ -5963,6 +6109,8 @@ +@@ -6015,6 +6161,8 @@ if (tp->rx_opt.tstamp_ok) tp->advmss -= TCPOLEN_TSTAMP_ALIGNED; @@ -4279,7 +4281,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (req) { /* Re-arm the timer because data may have been sent out. -@@ -5985,6 +6133,16 @@ +@@ -6037,6 +6185,16 @@ tcp_initialize_rcv_mss(sk); tcp_fast_path_on(tp); @@ -4296,7 +4298,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp break; case TCP_FIN_WAIT1: { -@@ -6032,7 +6190,8 @@ +@@ -6084,7 +6242,8 @@ tmo = tcp_fin_time(sk); if (tmo > TCP_TIMEWAIT_LEN) { inet_csk_reset_keepalive_timer(sk, tmo - TCP_TIMEWAIT_LEN); @@ -4306,7 +4308,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/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, -@@ -6041,7 +6200,7 @@ +@@ -6093,7 +6252,7 @@ */ inet_csk_reset_keepalive_timer(sk, tmo); } else { @@ -4315,7 +4317,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp goto discard; } break; -@@ -6049,7 +6208,7 @@ +@@ -6101,7 +6260,7 @@ case TCP_CLOSING: if (tp->snd_una == tp->write_seq) { @@ -4324,7 +4326,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp goto discard; } break; -@@ -6061,6 +6220,9 @@ +@@ -6113,6 +6272,9 @@ goto discard; } break; @@ -4334,7 +4336,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp } /* step 6: check the URG bit */ -@@ -6081,7 +6243,8 @@ +@@ -6133,7 +6295,8 @@ */ if (sk->sk_shutdown & RCV_SHUTDOWN) { if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && @@ -4344,7 +4346,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONDATA); tcp_reset(sk); return 1; -@@ -6178,6 +6341,8 @@ +@@ -6230,6 +6393,8 @@ ireq->wscale_ok = rx_opt->wscale_ok; ireq->acked = 0; ireq->ecn_ok = 0; @@ -4353,7 +4355,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/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); -@@ -6272,12 +6437,17 @@ +@@ -6324,12 +6489,17 @@ /* TW buckets are converted to open requests without * limitations, they conserve resources and peer is * evidently real one. @@ -4372,7 +4374,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp } if (sk_acceptq_is_full(sk)) { -@@ -6295,8 +6465,8 @@ +@@ -6347,8 +6517,8 @@ tcp_clear_options(&tmp_opt); tmp_opt.mss_clamp = af_ops->mss_clamp; tmp_opt.user_mss = tp->rx_opt.user_mss; @@ -4383,7 +4385,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (want_cookie && !tmp_opt.saw_tstamp) tcp_clear_options(&tmp_opt); -@@ -6308,7 +6478,8 @@ +@@ -6360,7 +6530,8 @@ /* Note: tcp_v6_init_req() might override ir_iif for link locals */ inet_rsk(req)->ir_iif = inet_request_bound_dev_if(sk, skb); @@ -4393,7 +4395,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp if (security_inet_conn_request(sk, skb, req)) goto drop_and_free; -@@ -6344,7 +6515,7 @@ +@@ -6396,7 +6567,7 @@ tcp_ecn_create_request(req, skb, sk, dst); if (want_cookie) { @@ -4402,7 +4404,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp req->cookie_ts = tmp_opt.tstamp_ok; if (!tmp_opt.tstamp_ok) inet_rsk(req)->ecn_ok = 0; -@@ -6358,12 +6529,18 @@ +@@ -6410,12 +6581,18 @@ fastopen_sk = tcp_try_fastopen(sk, skb, req, &foc); } if (fastopen_sk) { @@ -4422,9 +4424,9 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_input.c mptcp-mptcp_v0.94/net/ipv4/tcp_inp sock_put(fastopen_sk); } else { tcp_rsk(req)->tfo_listener = false; -diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4.c ---- linux-4.14.41/net/ipv4/tcp_ipv4.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c +--- a/net/ipv4/tcp_ipv4.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/tcp_ipv4.c 2018-08-22 02:56:26.000000000 +0200 @@ -67,6 +67,8 @@ #include #include @@ -4746,16 +4748,16 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 int ret; if (skb->pkt_type != PACKET_HOST) -@@ -1675,7 +1721,7 @@ +@@ -1679,7 +1725,7 @@ reqsk_put(req); - goto discard_it; + goto csum_error; } - if (unlikely(sk->sk_state != TCP_LISTEN)) { + if (unlikely(sk->sk_state != TCP_LISTEN && !is_meta_sk(sk))) { inet_csk_reqsk_queue_drop_and_put(sk, req); goto lookup; } -@@ -1684,6 +1730,36 @@ +@@ -1688,6 +1734,36 @@ */ sock_hold(sk); refcounted = true; @@ -4771,7 +4773,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 + } + + if (sock_owned_by_user(sk)) { -+ skb->sk = sk; ++ mptcp_prepare_for_backlog(sk, skb); + if (unlikely(sk_add_backlog(sk, skb, + sk->sk_rcvbuf + sk->sk_sndbuf))) { + reqsk_put(req); @@ -4792,7 +4794,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; -@@ -1693,11 +1769,15 @@ +@@ -1697,11 +1773,15 @@ } if (!nsk) { reqsk_put(req); @@ -4808,7 +4810,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 } else if (tcp_child_process(sk, nsk, skb)) { tcp_v4_send_reset(nsk, skb); goto discard_and_relse; -@@ -1734,15 +1814,24 @@ +@@ -1738,15 +1818,24 @@ sk_incoming_cpu_update(sk); @@ -4818,7 +4820,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 + + bh_lock_sock_nested(meta_sk); + if (sock_owned_by_user(meta_sk)) -+ skb->sk = sk; ++ mptcp_prepare_for_backlog(sk, skb); + } else { + meta_sk = sk; + bh_lock_sock_nested(sk); @@ -4837,7 +4839,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 put_and_return: if (refcounted) -@@ -1756,6 +1845,19 @@ +@@ -1760,6 +1849,19 @@ tcp_v4_fill_cb(skb, iph, th); @@ -4857,7 +4859,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 if (tcp_checksum_complete(skb)) { csum_error: __TCP_INC_STATS(net, TCP_MIB_CSUMERRORS); -@@ -1804,6 +1906,18 @@ +@@ -1808,6 +1910,18 @@ refcounted = false; goto process; } @@ -4876,7 +4878,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 /* Fall through to ACK */ } case TCP_TW_ACK: -@@ -1872,7 +1986,12 @@ +@@ -1876,7 +1990,12 @@ tcp_init_sock(sk); @@ -4890,7 +4892,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 #ifdef CONFIG_TCP_MD5SIG tcp_sk(sk)->af_specific = &tcp_sock_ipv4_specific; -@@ -1889,6 +2008,11 @@ +@@ -1893,6 +2012,11 @@ tcp_cleanup_congestion_control(sk); @@ -4902,7 +4904,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 tcp_cleanup_ulp(sk); /* Cleanup up the write buffer. */ -@@ -2435,7 +2559,15 @@ +@@ -2439,7 +2563,15 @@ .compat_setsockopt = compat_tcp_setsockopt, .compat_getsockopt = compat_tcp_getsockopt, #endif @@ -4918,9 +4920,9 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.94/net/ipv4/tcp_ipv4 }; EXPORT_SYMBOL(tcp_prot); -diff -aurN linux-4.14.41/net/ipv4/tcp_minisocks.c mptcp-mptcp_v0.94/net/ipv4/tcp_minisocks.c ---- linux-4.14.41/net/ipv4/tcp_minisocks.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/tcp_minisocks.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c +--- a/net/ipv4/tcp_minisocks.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/tcp_minisocks.c 2018-08-22 02:56:26.000000000 +0200 @@ -18,11 +18,13 @@ * Jorge Cwik, */ @@ -5120,7 +5122,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_minisocks.c mptcp-mptcp_v0.94/net/ipv4/tcp */ - __sk_add_backlog(child, skb); + if (mptcp(tcp_sk(child))) -+ skb->sk = child; ++ mptcp_prepare_for_backlog(child, skb); + __sk_add_backlog(meta_sk, skb); } @@ -5131,9 +5133,9 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_minisocks.c mptcp-mptcp_v0.94/net/ipv4/tcp sock_put(child); return ret; } -diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_output.c ---- linux-4.14.41/net/ipv4/tcp_output.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/tcp_output.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c +--- a/net/ipv4/tcp_output.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/tcp_output.c 2018-08-22 02:56:26.000000000 +0200 @@ -36,6 +36,12 @@ #define pr_fmt(fmt) "TCP: " fmt @@ -5160,7 +5162,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); -@@ -206,7 +209,7 @@ +@@ -211,7 +214,7 @@ void tcp_select_initial_window(int __space, __u32 mss, __u32 *rcv_wnd, __u32 *window_clamp, int wscale_ok, __u8 *rcv_wscale, @@ -5169,7 +5171,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { unsigned int space = (__space < 0 ? 0 : __space); -@@ -260,12 +263,16 @@ +@@ -265,12 +268,16 @@ * value can be stuffed directly into th->window for an outgoing * frame. */ @@ -5189,7 +5191,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou /* Never shrink the offered window */ if (new_win < cur_win) { -@@ -281,6 +288,7 @@ +@@ -286,6 +293,7 @@ LINUX_MIB_TCPWANTZEROWINDOWADV); new_win = ALIGN(cur_win, 1 << tp->rx_opt.rcv_wscale); } @@ -5197,7 +5199,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou tp->rcv_wnd = new_win; tp->rcv_wup = tp->rcv_nxt; -@@ -392,7 +400,7 @@ +@@ -397,7 +405,7 @@ /* Constructs common control bits of non-data skb. If SYN/FIN is present, * auto increment end seqno. */ @@ -5206,7 +5208,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { skb->ip_summed = CHECKSUM_PARTIAL; skb->csum = 0; -@@ -408,7 +416,7 @@ +@@ -413,7 +421,7 @@ TCP_SKB_CB(skb)->end_seq = seq; } @@ -5215,7 +5217,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { return tp->snd_una != tp->snd_up; } -@@ -418,17 +426,7 @@ +@@ -423,17 +431,7 @@ #define OPTION_MD5 (1 << 2) #define OPTION_WSCALE (1 << 3) #define OPTION_FAST_OPEN_COOKIE (1 << 8) @@ -5234,7 +5236,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou /* Write previously computed TCP options to the packet. * -@@ -444,7 +442,7 @@ +@@ -449,7 +447,7 @@ * (but it may well be that other scenarios fail similarly). */ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, @@ -5243,7 +5245,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { u16 options = opts->options; /* mungable copy */ -@@ -536,6 +534,9 @@ +@@ -541,6 +539,9 @@ } ptr += (len + 3) >> 2; } @@ -5253,7 +5255,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou } /* Compute TCP options for SYN packets. This is not the final -@@ -587,6 +588,8 @@ +@@ -592,6 +593,8 @@ if (unlikely(!(OPTION_TS & opts->options))) remaining -= TCPOLEN_SACKPERM_ALIGNED; } @@ -5262,7 +5264,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou if (fastopen && fastopen->cookie.len >= 0) { u32 need = fastopen->cookie.len; -@@ -663,6 +666,9 @@ +@@ -668,6 +671,9 @@ } } @@ -5272,7 +5274,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou return MAX_TCP_OPTION_SPACE - remaining; } -@@ -695,16 +701,22 @@ +@@ -700,16 +706,22 @@ opts->tsecr = tp->rx_opt.ts_recent; size += TCPOLEN_TSTAMP_ALIGNED; } @@ -5302,7 +5304,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou } return size; -@@ -744,8 +756,8 @@ +@@ -749,8 +761,8 @@ tcp_xmit_retransmit_queue(sk); } @@ -5313,7 +5315,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou } } /* -@@ -761,7 +773,7 @@ +@@ -766,7 +778,7 @@ unsigned long flags; struct list_head *q, *n; struct tcp_sock *tp; @@ -5322,7 +5324,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou local_irq_save(flags); list_splice_init(&tsq->head, &list); -@@ -775,14 +787,28 @@ +@@ -780,14 +792,28 @@ smp_mb__before_atomic(); clear_bit(TSQ_QUEUED, &sk->sk_tsq_flags); @@ -5355,7 +5357,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou } sk_free(sk); -@@ -792,7 +818,9 @@ +@@ -797,7 +823,9 @@ #define TCP_DEFERRED_ALL (TCPF_TSQ_DEFERRED | \ TCPF_WRITE_TIMER_DEFERRED | \ TCPF_DELACK_TIMER_DEFERRED | \ @@ -5366,7 +5368,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou /** * tcp_release_cb - tcp release_sock() callback * @sk: socket -@@ -812,8 +840,11 @@ +@@ -817,8 +845,11 @@ nflags = flags & ~TCP_DEFERRED_ALL; } while (cmpxchg(&sk->sk_tsq_flags, flags, nflags) != flags); @@ -5379,7 +5381,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou /* Here begins the tricky part : * We are called from release_sock() with : -@@ -838,6 +869,13 @@ +@@ -843,6 +874,13 @@ inet_csk(sk)->icsk_af_ops->mtu_reduced(sk); __sock_put(sk); } @@ -5393,7 +5395,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou } EXPORT_SYMBOL(tcp_release_cb); -@@ -1100,10 +1213,10 @@ +@@ -1080,10 +1118,10 @@ } } @@ -5406,13 +5408,18 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou tcp_ecn_send(sk, skb, th, tcp_header_size); } else { /* RFC1323: The window in SYN & SYN/ACK segments -@@ -1180,3 +1222,3 @@ +@@ -1140,8 +1178,8 @@ + return err; + } + -static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, - gfp_t gfp_mask) +int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, -+ gfp_t gfp_mask) ++ gfp_t gfp_mask) { -@@ -1140,7 +1178,7 @@ + return __tcp_transmit_skb(sk, skb, clone_it, gfp_mask, + tcp_sk(sk)->rcv_nxt); +@@ -1152,7 +1190,7 @@ * NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames, * otherwise socket can stall. */ @@ -5421,7 +5428,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { struct tcp_sock *tp = tcp_sk(sk); -@@ -1153,7 +1191,7 @@ +@@ -1165,7 +1203,7 @@ } /* Initialize TSO segments for a packet. */ @@ -5430,7 +5437,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { if (skb->len <= mss_now || skb->ip_summed == CHECKSUM_NONE) { /* Avoid the costly divide in the normal -@@ -1185,7 +1223,7 @@ +@@ -1197,7 +1235,7 @@ /* Pcount in the middle of the write queue got changed, we need to do various * tweaks to fix counters */ @@ -5439,7 +5446,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { struct tcp_sock *tp = tcp_sk(sk); -@@ -1337,7 +1375,7 @@ +@@ -1349,7 +1387,7 @@ /* This is similar to __pskb_pull_tail(). The difference is that pulled * data is not copied, but immediately discarded. */ @@ -5448,7 +5455,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { struct skb_shared_info *shinfo; int i, k, eat; -@@ -1560,6 +1598,7 @@ +@@ -1572,6 +1610,7 @@ return mss_now; } @@ -5456,7 +5463,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/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, -@@ -1583,7 +1622,7 @@ +@@ -1595,7 +1634,7 @@ tp->snd_cwnd_stamp = tcp_jiffies32; } @@ -5465,7 +5472,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; struct tcp_sock *tp = tcp_sk(sk); -@@ -1641,8 +1680,8 @@ +@@ -1653,8 +1692,8 @@ * But we can avoid doing the divide again given we already have * skb_pcount = skb->len / mss_now */ @@ -5476,7 +5483,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { if (skb->len < tcp_skb_pcount(skb) * mss_now) tp->snd_sml = TCP_SKB_CB(skb)->end_seq; -@@ -1700,11 +1739,11 @@ +@@ -1712,11 +1751,11 @@ } /* Returns the portion of skb which can be sent right away */ @@ -5493,7 +5500,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { const struct tcp_sock *tp = tcp_sk(sk); u32 partial, needed, window, max_len; -@@ -1734,13 +1773,14 @@ +@@ -1746,13 +1785,14 @@ /* Can at least one segment of SKB be sent right now, according to the * congestion window rules? If so, return how many segments are allowed. */ @@ -5511,7 +5518,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou tcp_skb_pcount(skb) == 1) return 1; -@@ -1760,7 +1800,7 @@ +@@ -1772,7 +1812,7 @@ * This must be invoked the first time we consider transmitting * SKB onto the wire. */ @@ -5520,7 +5527,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { int tso_segs = tcp_skb_pcount(skb); -@@ -1775,8 +1815,8 @@ +@@ -1787,8 +1827,8 @@ /* Return true if the Nagle test allows this packet to be * sent now. */ @@ -5531,7 +5538,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/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). -@@ -1788,7 +1828,8 @@ +@@ -1800,7 +1840,8 @@ return true; /* Don't use the nagle rule for urgent data (or for the final FIN). */ @@ -5541,7 +5548,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou return true; if (!tcp_nagle_check(skb->len < cur_mss, tp, nonagle)) -@@ -1798,9 +1839,8 @@ +@@ -1810,9 +1851,8 @@ } /* Does at least the first segment of SKB fit into the send window? */ @@ -5553,7 +5560,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { u32 end_seq = TCP_SKB_CB(skb)->end_seq; -@@ -1881,7 +1921,7 @@ +@@ -1893,7 +1933,7 @@ struct sk_buff *head; int win_divisor; @@ -5562,7 +5569,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou goto send_now; if (icsk->icsk_ca_state >= TCP_CA_Recovery) -@@ -2254,7 +2294,7 @@ +@@ -2266,7 +2306,7 @@ * Returns true, if no segments are in flight and we have queued segments, * but cannot send anything now because of SWS or another problem. */ @@ -5571,7 +5578,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou int push_one, gfp_t gfp) { struct tcp_sock *tp = tcp_sk(sk); -@@ -2268,7 +2308,12 @@ +@@ -2280,7 +2320,12 @@ sent_pkts = 0; tcp_mstamp_refresh(tp); @@ -5585,7 +5592,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou /* Do MTU probing. */ result = tcp_mtu_probe(sk); if (!result) { -@@ -2366,7 +2411,8 @@ +@@ -2378,7 +2423,8 @@ if (push_one != 2) tcp_schedule_loss_probe(sk, false); is_cwnd_limited |= (tcp_packets_in_flight(tp) >= tp->snd_cwnd); @@ -5595,7 +5602,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou return false; } return !tp->packets_out && tcp_send_head(sk); -@@ -2451,7 +2497,7 @@ +@@ -2463,7 +2509,7 @@ if (skb) { if (tcp_snd_wnd_test(tp, skb, mss)) { pcount = tp->packets_out; @@ -5604,7 +5611,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou if (tp->packets_out > pcount) goto probe_sent; goto rearm_timer; -@@ -2514,8 +2560,8 @@ +@@ -2526,8 +2572,8 @@ if (unlikely(sk->sk_state == TCP_CLOSE)) return; @@ -5615,7 +5622,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou tcp_check_probe_timer(sk); } -@@ -2528,7 +2574,8 @@ +@@ -2540,7 +2586,8 @@ BUG_ON(!skb || skb->len < mss_now); @@ -5625,7 +5632,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou } /* This function returns the amount that we can raise the -@@ -2761,6 +2808,10 @@ +@@ -2773,6 +2820,10 @@ if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) return; @@ -5636,7 +5643,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou tcp_for_write_queue_from_safe(skb, tmp, sk) { if (!tcp_can_collapse(sk, skb)) break; -@@ -3216,7 +3267,7 @@ +@@ -3230,7 +3281,7 @@ /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ th->window = htons(min(req->rsk_rcv_wnd, 65535U)); @@ -5645,7 +5652,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou th->doff = (tcp_header_size >> 2); __TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); -@@ -3297,13 +3348,13 @@ +@@ -3311,13 +3362,13 @@ if (rcv_wnd == 0) rcv_wnd = dst_metric(dst, RTAX_INITRWND); @@ -5666,7 +5673,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou tp->rx_opt.rcv_wscale = rcv_wscale; tp->rcv_ssthresh = tp->rcv_wnd; -@@ -3327,6 +3378,36 @@ +@@ -3342,6 +3393,36 @@ inet_csk(sk)->icsk_rto = tcp_timeout_init(sk); inet_csk(sk)->icsk_retransmits = 0; tcp_clear_retrans(tp); @@ -5703,7 +5710,15 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou } static void tcp_connect_queue_skb(struct sock *sk, struct sk_buff *skb) -@@ -3598,7 +3679,7 @@ +@@ -3606,6 +3687,7 @@ + { + __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); + } ++EXPORT_SYMBOL_GPL(tcp_send_ack); + + /* This routine sends a packet with an out of date sequence + * number. It assumes the other end will try to ack it. +@@ -3618,7 +3700,7 @@ * one is with SEG.SEQ=SND.UNA to deliver urgent pointer, another is * out-of-date with SND.UNA-1 to probe window. */ @@ -5712,7 +5727,7 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou { struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb; -@@ -3684,7 +3765,7 @@ +@@ -3704,7 +3786,7 @@ unsigned long probe_max; int err; @@ -5721,9 +5736,9 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_output.c mptcp-mptcp_v0.94/net/ipv4/tcp_ou if (tp->packets_out || !tcp_send_head(sk)) { /* Cancel probe timer, if it is not required. */ -diff -aurN linux-4.14.41/net/ipv4/tcp_timer.c mptcp-mptcp_v0.94/net/ipv4/tcp_timer.c ---- linux-4.14.41/net/ipv4/tcp_timer.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv4/tcp_timer.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c +--- a/net/ipv4/tcp_timer.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv4/tcp_timer.c 2018-08-22 02:56:26.000000000 +0200 @@ -20,6 +20,7 @@ #include @@ -5921,9 +5936,9 @@ diff -aurN linux-4.14.41/net/ipv4/tcp_timer.c mptcp-mptcp_v0.94/net/ipv4/tcp_tim sock_put(sk); } -diff -aurN linux-4.14.41/net/ipv6/addrconf.c mptcp-mptcp_v0.94/net/ipv6/addrconf.c ---- linux-4.14.41/net/ipv6/addrconf.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv6/addrconf.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c +--- a/net/ipv6/addrconf.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv6/addrconf.c 2018-08-22 02:56:26.000000000 +0200 @@ -928,6 +928,7 @@ kfree_rcu(ifp, rcu); @@ -5932,9 +5947,9 @@ diff -aurN linux-4.14.41/net/ipv6/addrconf.c mptcp-mptcp_v0.94/net/ipv6/addrconf static void ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) -diff -aurN linux-4.14.41/net/ipv6/af_inet6.c mptcp-mptcp_v0.94/net/ipv6/af_inet6.c ---- linux-4.14.41/net/ipv6/af_inet6.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv6/af_inet6.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c +--- a/net/ipv6/af_inet6.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv6/af_inet6.c 2018-08-22 02:56:26.000000000 +0200 @@ -107,8 +107,7 @@ return (struct ipv6_pinfo *)(((u8 *)sk) + offset); } @@ -5945,9 +5960,9 @@ diff -aurN linux-4.14.41/net/ipv6/af_inet6.c mptcp-mptcp_v0.94/net/ipv6/af_inet6 { struct inet_sock *inet; struct ipv6_pinfo *np; -diff -aurN linux-4.14.41/net/ipv6/ipv6_sockglue.c mptcp-mptcp_v0.94/net/ipv6/ipv6_sockglue.c ---- linux-4.14.41/net/ipv6/ipv6_sockglue.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv6/ipv6_sockglue.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c +--- a/net/ipv6/ipv6_sockglue.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv6/ipv6_sockglue.c 2018-08-22 02:56:26.000000000 +0200 @@ -48,6 +48,8 @@ #include #include @@ -5971,9 +5986,9 @@ diff -aurN linux-4.14.41/net/ipv6/ipv6_sockglue.c mptcp-mptcp_v0.94/net/ipv6/ipv sk->sk_socket->ops = &inet_stream_ops; sk->sk_family = PF_INET; tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); -diff -aurN linux-4.14.41/net/ipv6/syncookies.c mptcp-mptcp_v0.94/net/ipv6/syncookies.c ---- linux-4.14.41/net/ipv6/syncookies.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv6/syncookies.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c +--- a/net/ipv6/syncookies.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv6/syncookies.c 2018-08-22 02:56:26.000000000 +0200 @@ -20,6 +20,8 @@ #include #include @@ -6055,9 +6070,9 @@ diff -aurN linux-4.14.41/net/ipv6/syncookies.c mptcp-mptcp_v0.94/net/ipv6/syncoo ireq->rcv_wscale = rcv_wscale; ireq->ecn_ok = cookie_ecn_ok(&tcp_opt, sock_net(sk), dst); -diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6.c ---- linux-4.14.41/net/ipv6/tcp_ipv6.c 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c +--- a/net/ipv6/tcp_ipv6.c 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/ipv6/tcp_ipv6.c 2018-08-22 02:56:26.000000000 +0200 @@ -61,6 +61,8 @@ #include #include @@ -6310,7 +6325,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 { const struct tcphdr *th = tcp_hdr(skb); u32 seq = 0, ack_seq = 0; -@@ -940,7 +969,7 @@ +@@ -941,7 +970,7 @@ (th->doff << 2); oif = sk ? sk->sk_bound_dev_if : 0; @@ -6319,7 +6334,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 #ifdef CONFIG_TCP_MD5SIG out: -@@ -949,30 +978,37 @@ +@@ -950,30 +979,37 @@ } static void tcp_v6_send_ack(const struct sock *sk, struct sk_buff *skb, u32 seq, @@ -6364,7 +6379,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 { /* sk->sk_state == TCP_LISTEN -> for regular TCP_SYN_RECV * sk->sk_state == TCP_SYN_RECV -> for Fast Open. -@@ -982,18 +1018,18 @@ +@@ -983,18 +1019,18 @@ * exception of segments, MUST be right-shifted by * Rcv.Wind.Shift bits: */ @@ -6387,7 +6402,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 { #ifdef CONFIG_SYN_COOKIES const struct tcphdr *th = tcp_hdr(skb); -@@ -1004,7 +1040,7 @@ +@@ -1005,7 +1041,7 @@ return sk; } @@ -6396,7 +6411,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 { if (skb->protocol == htons(ETH_P_IP)) return tcp_v4_conn_request(sk, skb); -@@ -1030,11 +1066,11 @@ +@@ -1031,11 +1067,11 @@ sizeof(struct inet6_skb_parm)); } @@ -6413,7 +6428,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 { struct inet_request_sock *ireq; struct ipv6_pinfo *newnp; -@@ -1071,7 +1107,15 @@ +@@ -1072,7 +1108,15 @@ newnp->saddr = newsk->sk_v6_rcv_saddr; @@ -6430,7 +6445,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 newsk->sk_backlog_rcv = tcp_v4_do_rcv; #ifdef CONFIG_TCP_MD5SIG newtp->af_specific = &tcp_sock_ipv6_mapped_specific; -@@ -1118,6 +1162,14 @@ +@@ -1119,6 +1163,14 @@ if (!newsk) goto out_nonewsk; @@ -6445,7 +6460,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/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 -@@ -1246,7 +1298,7 @@ +@@ -1247,7 +1299,7 @@ * This is because we cannot sleep with the original spinlock * held. */ @@ -6454,7 +6469,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 { struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_sock *tp; -@@ -1263,6 +1315,9 @@ +@@ -1264,6 +1316,9 @@ if (skb->protocol == htons(ETH_P_IP)) return tcp_v4_do_rcv(sk, skb); @@ -6464,7 +6479,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 /* * socket locking is here for SMP purposes as backlog rcv * is currently called with bh processing disabled. -@@ -1390,6 +1445,10 @@ +@@ -1391,6 +1446,10 @@ TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + skb->len - th->doff*4); TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); @@ -6475,7 +6490,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/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); -@@ -1403,8 +1462,8 @@ +@@ -1404,8 +1463,8 @@ int sdif = inet6_sdif(skb); const struct tcphdr *th; const struct ipv6hdr *hdr; @@ -6485,9 +6500,9 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 int ret; struct net *net = dev_net(skb->dev); -@@ -1453,12 +1512,42 @@ +@@ -1458,12 +1517,42 @@ reqsk_put(req); - goto discard_it; + goto csum_error; } - if (unlikely(sk->sk_state != TCP_LISTEN)) { + if (unlikely(sk->sk_state != TCP_LISTEN && !is_meta_sk(sk))) { @@ -6508,7 +6523,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 + } + + if (sock_owned_by_user(sk)) { -+ skb->sk = sk; ++ mptcp_prepare_for_backlog(sk, skb); + if (unlikely(sk_add_backlog(sk, skb, + sk->sk_rcvbuf + sk->sk_sndbuf))) { + reqsk_put(req); @@ -6529,7 +6544,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; -@@ -1468,10 +1557,14 @@ +@@ -1473,10 +1562,14 @@ } if (!nsk) { reqsk_put(req); @@ -6544,7 +6559,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 tcp_v6_restore_cb(skb); } else if (tcp_child_process(sk, nsk, skb)) { tcp_v6_send_reset(nsk, skb); -@@ -1481,6 +1574,7 @@ +@@ -1486,6 +1579,7 @@ return 0; } } @@ -6552,7 +6567,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 if (hdr->hop_limit < inet6_sk(sk)->min_hopcount) { __NET_INC_STATS(net, LINUX_MIB_TCPMINTTLDROP); goto discard_and_relse; -@@ -1507,15 +1601,25 @@ +@@ -1512,15 +1606,25 @@ sk_incoming_cpu_update(sk); @@ -6562,7 +6577,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 + + bh_lock_sock_nested(meta_sk); + if (sock_owned_by_user(meta_sk)) -+ skb->sk = sk; ++ mptcp_prepare_for_backlog(sk, skb); + } else { + meta_sk = sk; + bh_lock_sock_nested(sk); @@ -6582,7 +6597,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 put_and_return: if (refcounted) -@@ -1528,6 +1632,19 @@ +@@ -1533,6 +1637,19 @@ tcp_v6_fill_cb(skb, hdr, th); @@ -6602,7 +6617,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 if (tcp_checksum_complete(skb)) { csum_error: __TCP_INC_STATS(net, TCP_MIB_CSUMERRORS); -@@ -1579,6 +1696,18 @@ +@@ -1585,6 +1702,18 @@ refcounted = false; goto process; } @@ -6621,7 +6636,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 /* Fall through to ACK */ } case TCP_TW_ACK: -@@ -1632,13 +1761,13 @@ +@@ -1638,13 +1767,13 @@ } } @@ -6637,7 +6652,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 .queue_xmit = inet6_csk_xmit, .send_check = tcp_v6_send_check, .rebuild_header = inet6_sk_rebuild_header, -@@ -1669,7 +1798,7 @@ +@@ -1675,7 +1804,7 @@ /* * TCP over IPv4 via INET6 API */ @@ -6646,7 +6661,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 .queue_xmit = ip_queue_xmit, .send_check = tcp_v4_send_check, .rebuild_header = inet_sk_rebuild_header, -@@ -1705,7 +1834,12 @@ +@@ -1711,7 +1840,12 @@ tcp_init_sock(sk); @@ -6660,7 +6675,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 #ifdef CONFIG_TCP_MD5SIG tcp_sk(sk)->af_specific = &tcp_sock_ipv6_specific; -@@ -1714,7 +1848,7 @@ +@@ -1720,7 +1854,7 @@ return 0; } @@ -6669,7 +6684,7 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 { tcp_v4_destroy_sock(sk); inet6_destroy_sock(sk); -@@ -1948,6 +2082,9 @@ +@@ -1954,6 +2088,9 @@ .compat_getsockopt = compat_tcp_getsockopt, #endif .diag_destroy = tcp_abort, @@ -6679,9 +6694,9 @@ diff -aurN linux-4.14.41/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.94/net/ipv6/tcp_ipv6 }; /* thinking of making this const? Don't. -diff -aurN linux-4.14.41/net/Kconfig mptcp-mptcp_v0.94/net/Kconfig ---- linux-4.14.41/net/Kconfig 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/Kconfig 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/Kconfig b/net/Kconfig +--- a/net/Kconfig 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/Kconfig 2018-08-22 02:56:26.000000000 +0200 @@ -88,6 +88,7 @@ source "net/ipv4/Kconfig" source "net/ipv6/Kconfig" @@ -6690,9 +6705,9 @@ diff -aurN linux-4.14.41/net/Kconfig mptcp-mptcp_v0.94/net/Kconfig endif # if INET -diff -aurN linux-4.14.41/net/Makefile mptcp-mptcp_v0.94/net/Makefile ---- linux-4.14.41/net/Makefile 2018-05-16 10:10:32.000000000 +0200 -+++ mptcp-mptcp_v0.94/net/Makefile 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/Makefile b/net/Makefile +--- a/net/Makefile 2018-08-17 21:01:12.000000000 +0200 ++++ b/net/Makefile 2018-08-22 02:56:26.000000000 +0200 @@ -20,6 +20,7 @@ obj-$(CONFIG_XFRM) += xfrm/ obj-$(CONFIG_UNIX) += unix/ @@ -6701,9 +6716,9 @@ diff -aurN linux-4.14.41/net/Makefile mptcp-mptcp_v0.94/net/Makefile obj-$(CONFIG_PACKET) += packet/ obj-$(CONFIG_NET_KEY) += key/ obj-$(CONFIG_BRIDGE) += bridge/ -diff -aurN linux-4.14.41/net/mptcp/Kconfig mptcp-mptcp_v0.94/net/mptcp/Kconfig ---- linux-4.14.41/net/mptcp/Kconfig 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/Kconfig 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/Kconfig b/net/mptcp/Kconfig +--- a/net/mptcp/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/Kconfig 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,129 @@ +# +# MPTCP configuration @@ -6834,9 +6849,9 @@ diff -aurN linux-4.14.41/net/mptcp/Kconfig mptcp-mptcp_v0.94/net/mptcp/Kconfig + default "redundant" if DEFAULT_REDUNDANT + default "default" + -diff -aurN linux-4.14.41/net/mptcp/Makefile mptcp-mptcp_v0.94/net/mptcp/Makefile ---- linux-4.14.41/net/mptcp/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/Makefile 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/Makefile b/net/mptcp/Makefile +--- a/net/mptcp/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/Makefile 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,22 @@ +# +## Makefile for MultiPath TCP support code. @@ -6860,9 +6875,9 @@ diff -aurN linux-4.14.41/net/mptcp/Makefile mptcp-mptcp_v0.94/net/mptcp/Makefile + +mptcp-$(subst m,y,$(CONFIG_IPV6)) += mptcp_ipv6.o + -diff -aurN linux-4.14.41/net/mptcp/mptcp_balia.c mptcp-mptcp_v0.94/net/mptcp/mptcp_balia.c ---- linux-4.14.41/net/mptcp/mptcp_balia.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_balia.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_balia.c b/net/mptcp/mptcp_balia.c +--- a/net/mptcp/mptcp_balia.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_balia.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,268 @@ +/* + * MPTCP implementation - Balia Congestion Control @@ -7132,9 +7147,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_balia.c mptcp-mptcp_v0.94/net/mptcp/mpt +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP BALIA CONGESTION CONTROL ALGORITHM"); +MODULE_VERSION("0.1"); -diff -aurN linux-4.14.41/net/mptcp/mptcp_binder.c mptcp-mptcp_v0.94/net/mptcp/mptcp_binder.c ---- linux-4.14.41/net/mptcp/mptcp_binder.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_binder.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_binder.c b/net/mptcp/mptcp_binder.c +--- a/net/mptcp/mptcp_binder.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_binder.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,486 @@ +#include + @@ -7622,9 +7637,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_binder.c mptcp-mptcp_v0.94/net/mptcp/mp +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("BINDER MPTCP"); +MODULE_VERSION("0.1"); -diff -aurN linux-4.14.41/net/mptcp/mptcp_coupled.c mptcp-mptcp_v0.94/net/mptcp/mptcp_coupled.c ---- linux-4.14.41/net/mptcp/mptcp_coupled.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_coupled.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_coupled.c b/net/mptcp/mptcp_coupled.c +--- a/net/mptcp/mptcp_coupled.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_coupled.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,271 @@ +/* + * MPTCP implementation - Linked Increase congestion control Algorithm (LIA) @@ -7897,10 +7912,10 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_coupled.c mptcp-mptcp_v0.94/net/mptcp/m +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP LINKED INCREASE CONGESTION CONTROL ALGORITHM"); +MODULE_VERSION("0.1"); -diff -aurN linux-4.14.41/net/mptcp/mptcp_ctrl.c mptcp-mptcp_v0.94/net/mptcp/mptcp_ctrl.c ---- linux-4.14.41/net/mptcp/mptcp_ctrl.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_ctrl.c 2018-07-20 10:46:09.000000000 +0200 -@@ -0,0 +1,2914 @@ +diff -aurN a/net/mptcp/mptcp_ctrl.c b/net/mptcp/mptcp_ctrl.c +--- a/net/mptcp/mptcp_ctrl.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_ctrl.c 2018-08-22 02:56:26.000000000 +0200 +@@ -0,0 +1,2928 @@ +/* + * MPTCP implementation - MPTCP-control + * @@ -8887,6 +8902,16 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_ctrl.c mptcp-mptcp_v0.94/net/mptcp/mptc + inet_sk(sub_sk)->recverr = 0; +} + ++void mptcp_prepare_for_backlog(struct sock *sk, struct sk_buff *skb) ++{ ++ /* In case of success (in mptcp_backlog_rcv) and error (in kfree_skb) of ++ * sk_add_backlog, we will decrement the sk refcount. ++ */ ++ sock_hold(sk); ++ skb->sk = sk; ++ skb->destructor = sock_efree; ++} ++ +int mptcp_backlog_rcv(struct sock *meta_sk, struct sk_buff *skb) +{ + /* skb-sk may be NULL if we receive a packet immediatly after the @@ -8895,13 +8920,17 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_ctrl.c mptcp-mptcp_v0.94/net/mptcp/mptc + struct sock *sk = skb->sk ? skb->sk : meta_sk; + int ret = 0; + -+ skb->sk = NULL; -+ + if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt))) { + kfree_skb(skb); + return 0; + } + ++ /* Decrement sk refcnt when calling the skb destructor. ++ * Refcnt is incremented and skb destructor is set in tcp_v{4,6}_rcv via ++ * mptcp_prepare_for_backlog() here above. ++ */ ++ skb_orphan(skb); ++ + if (sk->sk_family == AF_INET) + ret = tcp_v4_do_rcv(sk, skb); +#if IS_ENABLED(CONFIG_IPV6) @@ -10815,9 +10844,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_ctrl.c mptcp-mptcp_v0.94/net/mptcp/mptc +mptcp_sock_cache_failed: + mptcp_init_failed = true; +} -diff -aurN linux-4.14.41/net/mptcp/mptcp_fullmesh.c mptcp-mptcp_v0.94/net/mptcp/mptcp_fullmesh.c ---- linux-4.14.41/net/mptcp/mptcp_fullmesh.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_fullmesh.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_fullmesh.c b/net/mptcp/mptcp_fullmesh.c +--- a/net/mptcp/mptcp_fullmesh.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_fullmesh.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,2013 @@ +#include +#include @@ -12832,10 +12861,10 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_fullmesh.c mptcp-mptcp_v0.94/net/mptcp/ +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Full-Mesh MPTCP"); +MODULE_VERSION("0.88"); -diff -aurN linux-4.14.41/net/mptcp/mptcp_input.c mptcp-mptcp_v0.94/net/mptcp/mptcp_input.c ---- linux-4.14.41/net/mptcp/mptcp_input.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_input.c 2018-07-20 10:46:09.000000000 +0200 -@@ -0,0 +1,2467 @@ +diff -aurN a/net/mptcp/mptcp_input.c b/net/mptcp/mptcp_input.c +--- a/net/mptcp/mptcp_input.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_input.c 2018-08-22 02:56:26.000000000 +0200 +@@ -0,0 +1,2465 @@ +/* + * MPTCP implementation - Sending side + * @@ -13804,7 +13833,7 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_input.c mptcp-mptcp_v0.94/net/mptcp/mpt + /* Quick ACK if more 3/4 of the receive window is filled */ + if (after64(tp->mptcp->map_data_seq, + rcv_nxt64 + 3 * (tcp_receive_window(meta_tp) >> 2))) -+ tcp_enter_quickack_mode(sk,TCP_MAX_QUICKACKS); ++ tcp_enter_quickack_mode(sk, TCP_MAX_QUICKACKS); + + } else { + /* Ready for the meta-rcv-queue */ @@ -14022,7 +14051,6 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_input.c mptcp-mptcp_v0.94/net/mptcp/mpt + */ + bh_lock_sock_nested(meta_sk); + if (sock_owned_by_user(meta_sk)) { -+ skb->sk = meta_sk; + if (unlikely(sk_add_backlog(meta_sk, skb, + meta_sk->sk_rcvbuf + meta_sk->sk_sndbuf))) { + bh_unlock_sock(meta_sk); @@ -14095,7 +14123,6 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_input.c mptcp-mptcp_v0.94/net/mptcp/mpt + } + + if (sock_owned_by_user(meta_sk)) { -+ skb->sk = meta_sk; + if (unlikely(sk_add_backlog(meta_sk, skb, + meta_sk->sk_rcvbuf + meta_sk->sk_sndbuf))) + __NET_INC_STATS(net, LINUX_MIB_TCPBACKLOGDROP); @@ -15303,9 +15330,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_input.c mptcp-mptcp_v0.94/net/mptcp/mpt + tcp_set_rto(sk); + mptcp_set_rto(sk); +} -diff -aurN linux-4.14.41/net/mptcp/mptcp_ipv4.c mptcp-mptcp_v0.94/net/mptcp/mptcp_ipv4.c ---- linux-4.14.41/net/mptcp/mptcp_ipv4.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_ipv4.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_ipv4.c b/net/mptcp/mptcp_ipv4.c +--- a/net/mptcp/mptcp_ipv4.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_ipv4.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,437 @@ +/* + * MPTCP implementation - IPv4-specific functions @@ -15744,9 +15771,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_ipv4.c mptcp-mptcp_v0.94/net/mptcp/mptc + kmem_cache_destroy(mptcp_request_sock_ops.slab); + kfree(mptcp_request_sock_ops.slab_name); +} -diff -aurN linux-4.14.41/net/mptcp/mptcp_ipv6.c mptcp-mptcp_v0.94/net/mptcp/mptcp_ipv6.c ---- linux-4.14.41/net/mptcp/mptcp_ipv6.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_ipv6.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_ipv6.c b/net/mptcp/mptcp_ipv6.c +--- a/net/mptcp/mptcp_ipv6.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_ipv6.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,465 @@ +/* + * MPTCP implementation - IPv6-specific functions @@ -16213,9 +16240,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_ipv6.c mptcp-mptcp_v0.94/net/mptcp/mptc + kmem_cache_destroy(mptcp6_request_sock_ops.slab); + kfree(mptcp6_request_sock_ops.slab_name); +} -diff -aurN linux-4.14.41/net/mptcp/mptcp_ndiffports.c mptcp-mptcp_v0.94/net/mptcp/mptcp_ndiffports.c ---- linux-4.14.41/net/mptcp/mptcp_ndiffports.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_ndiffports.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_ndiffports.c b/net/mptcp/mptcp_ndiffports.c +--- a/net/mptcp/mptcp_ndiffports.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_ndiffports.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,169 @@ +#include + @@ -16386,9 +16413,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_ndiffports.c mptcp-mptcp_v0.94/net/mptc +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("NDIFF-PORTS MPTCP"); +MODULE_VERSION("0.88"); -diff -aurN linux-4.14.41/net/mptcp/mptcp_olia.c mptcp-mptcp_v0.94/net/mptcp/mptcp_olia.c ---- linux-4.14.41/net/mptcp/mptcp_olia.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_olia.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_olia.c b/net/mptcp/mptcp_olia.c +--- a/net/mptcp/mptcp_olia.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_olia.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,310 @@ +/* + * MPTCP implementation - OPPORTUNISTIC LINKED INCREASES CONGESTION CONTROL: @@ -16700,9 +16727,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_olia.c mptcp-mptcp_v0.94/net/mptcp/mptc +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP COUPLED CONGESTION CONTROL"); +MODULE_VERSION("0.1"); -diff -aurN linux-4.14.41/net/mptcp/mptcp_output.c mptcp-mptcp_v0.94/net/mptcp/mptcp_output.c ---- linux-4.14.41/net/mptcp/mptcp_output.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_output.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_output.c b/net/mptcp/mptcp_output.c +--- a/net/mptcp/mptcp_output.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_output.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,1813 @@ +/* + * MPTCP implementation - Sending side @@ -18517,9 +18544,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_output.c mptcp-mptcp_v0.94/net/mptcp/mp + return max(xmit_size_goal, mss_now); +} + -diff -aurN linux-4.14.41/net/mptcp/mptcp_pm.c mptcp-mptcp_v0.94/net/mptcp/mptcp_pm.c ---- linux-4.14.41/net/mptcp/mptcp_pm.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_pm.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_pm.c b/net/mptcp/mptcp_pm.c +--- a/net/mptcp/mptcp_pm.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_pm.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,226 @@ +/* + * MPTCP implementation - MPTCP-subflow-management @@ -18747,9 +18774,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_pm.c mptcp-mptcp_v0.94/net/mptcp/mptcp_ + return mptcp_set_default_path_manager(CONFIG_DEFAULT_MPTCP_PM); +} +late_initcall(mptcp_path_manager_default); -diff -aurN linux-4.14.41/net/mptcp/mptcp_redundant.c mptcp-mptcp_v0.94/net/mptcp/mptcp_redundant.c ---- linux-4.14.41/net/mptcp/mptcp_redundant.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_redundant.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_redundant.c b/net/mptcp/mptcp_redundant.c +--- a/net/mptcp/mptcp_redundant.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_redundant.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,301 @@ +/* + * MPTCP Scheduler to reduce latency and jitter. @@ -19052,9 +19079,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_redundant.c mptcp-mptcp_v0.94/net/mptcp +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("REDUNDANT MPTCP"); +MODULE_VERSION("0.90"); -diff -aurN linux-4.14.41/net/mptcp/mptcp_rr.c mptcp-mptcp_v0.94/net/mptcp/mptcp_rr.c ---- linux-4.14.41/net/mptcp/mptcp_rr.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_rr.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_rr.c b/net/mptcp/mptcp_rr.c +--- a/net/mptcp/mptcp_rr.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_rr.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,301 @@ +/* MPTCP Scheduler module selector. Highly inspired by tcp_cong.c */ + @@ -19357,9 +19384,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_rr.c mptcp-mptcp_v0.94/net/mptcp/mptcp_ +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("ROUNDROBIN MPTCP"); +MODULE_VERSION("0.89"); -diff -aurN linux-4.14.41/net/mptcp/mptcp_sched.c mptcp-mptcp_v0.94/net/mptcp/mptcp_sched.c ---- linux-4.14.41/net/mptcp/mptcp_sched.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_sched.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_sched.c b/net/mptcp/mptcp_sched.c +--- a/net/mptcp/mptcp_sched.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_sched.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,627 @@ +/* MPTCP Scheduler module selector. Highly inspired by tcp_cong.c */ + @@ -19988,9 +20015,9 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_sched.c mptcp-mptcp_v0.94/net/mptcp/mpt + return mptcp_set_default_scheduler(CONFIG_DEFAULT_MPTCP_SCHED); +} +late_initcall(mptcp_scheduler_default); -diff -aurN linux-4.14.41/net/mptcp/mptcp_wvegas.c mptcp-mptcp_v0.94/net/mptcp/mptcp_wvegas.c ---- linux-4.14.41/net/mptcp/mptcp_wvegas.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.94/net/mptcp/mptcp_wvegas.c 2018-07-20 10:46:09.000000000 +0200 +diff -aurN a/net/mptcp/mptcp_wvegas.c b/net/mptcp/mptcp_wvegas.c +--- a/net/mptcp/mptcp_wvegas.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/net/mptcp/mptcp_wvegas.c 2018-08-22 02:56:26.000000000 +0200 @@ -0,0 +1,270 @@ +/* + * MPTCP implementation - WEIGHTED VEGAS @@ -20262,141 +20289,3 @@ diff -aurN linux-4.14.41/net/mptcp/mptcp_wvegas.c mptcp-mptcp_v0.94/net/mptcp/mp +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP wVegas"); +MODULE_VERSION("0.1"); -diff --git a/include/net/mptcp.h b/include/net/mptcp.h -index 222b551bb58b..818a0fa3a2a9 100644 ---- a/include/net/mptcp.h -+++ b/include/net/mptcp.h -@@ -834,6 +834,7 @@ void mptcp_sub_close_wq(struct work_struct *work); - void mptcp_sub_close(struct sock *sk, unsigned long delay); - struct sock *mptcp_select_ack_sock(const struct sock *meta_sk); - void mptcp_fallback_meta_sk(struct sock *meta_sk); -+void mptcp_prepare_for_backlog(struct sock *sk, struct sk_buff *skb); - int mptcp_backlog_rcv(struct sock *meta_sk, struct sk_buff *skb); - void mptcp_ack_handler(unsigned long); - bool mptcp_check_rtt(const struct tcp_sock *tp, int time); -@@ -1438,6 +1439,7 @@ static inline bool mptcp_fallback_infinite(const struct sock *sk, int flag) - return false; - } - static inline void mptcp_init_mp_opt(const struct mptcp_options_received *mopt) {} -+static inline void mptcp_prepare_for_backlog(struct sock *sk, struct sk_buff *skb) {} - static inline bool mptcp_check_rtt(const struct tcp_sock *tp, int time) - { - return false; -diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c -index 830849e683e6..15b90061a38f 100644 ---- a/net/ipv4/tcp_ipv4.c -+++ b/net/ipv4/tcp_ipv4.c -@@ -1742,7 +1742,7 @@ int tcp_v4_rcv(struct sk_buff *skb) - } - - if (sock_owned_by_user(sk)) { -- skb->sk = sk; -+ mptcp_prepare_for_backlog(sk, skb); - if (unlikely(sk_add_backlog(sk, skb, - sk->sk_rcvbuf + sk->sk_sndbuf))) { - reqsk_put(req); -@@ -1819,7 +1819,7 @@ int tcp_v4_rcv(struct sk_buff *skb) - - bh_lock_sock_nested(meta_sk); - if (sock_owned_by_user(meta_sk)) -- skb->sk = sk; -+ mptcp_prepare_for_backlog(sk, skb); - } else { - meta_sk = sk; - bh_lock_sock_nested(sk); -diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c -index dd86c448c5af..a2c0187d8366 100644 ---- a/net/ipv6/tcp_ipv6.c -+++ b/net/ipv6/tcp_ipv6.c -@@ -1530,7 +1530,7 @@ static int tcp_v6_rcv(struct sk_buff *skb) - } - - if (sock_owned_by_user(sk)) { -- skb->sk = sk; -+ mptcp_prepare_for_backlog(sk, skb); - if (unlikely(sk_add_backlog(sk, skb, - sk->sk_rcvbuf + sk->sk_sndbuf))) { - reqsk_put(req); -@@ -1606,7 +1606,7 @@ static int tcp_v6_rcv(struct sk_buff *skb) - - bh_lock_sock_nested(meta_sk); - if (sock_owned_by_user(meta_sk)) -- skb->sk = sk; -+ mptcp_prepare_for_backlog(sk, skb); - } else { - meta_sk = sk; - bh_lock_sock_nested(sk); -diff --git a/net/mptcp/mptcp_ctrl.c b/net/mptcp/mptcp_ctrl.c -index faf8a6cdbcc7..b46682eee745 100644 ---- a/net/mptcp/mptcp_ctrl.c -+++ b/net/mptcp/mptcp_ctrl.c -@@ -984,6 +984,16 @@ static void mptcp_sub_inherit_sockopts(const struct sock *meta_sk, struct sock * - inet_sk(sub_sk)->recverr = 0; - } - -+void mptcp_prepare_for_backlog(struct sock *sk, struct sk_buff *skb) -+{ -+ /* In case of success (in mptcp_backlog_rcv) and error (in kfree_skb) of -+ * sk_add_backlog, we will decrement the sk refcount. -+ */ -+ sock_hold(sk); -+ skb->sk = sk; -+ skb->destructor = sock_efree; -+} -+ - int mptcp_backlog_rcv(struct sock *meta_sk, struct sk_buff *skb) - { - /* skb-sk may be NULL if we receive a packet immediatly after the -@@ -992,13 +1002,17 @@ int mptcp_backlog_rcv(struct sock *meta_sk, struct sk_buff *skb) - struct sock *sk = skb->sk ? skb->sk : meta_sk; - int ret = 0; - -- skb->sk = NULL; -- - if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt))) { - kfree_skb(skb); - return 0; - } - -+ /* Decrement sk refcnt when calling the skb destructor. -+ * Refcnt is incremented and skb destructor is set in tcp_v{4,6}_rcv via -+ * mptcp_prepare_for_backlog() here above. -+ */ -+ skb_orphan(skb); -+ - if (sk->sk_family == AF_INET) - ret = tcp_v4_do_rcv(sk, skb); - #if IS_ENABLED(CONFIG_IPV6) -diff --git a/net/mptcp/mptcp_input.c b/net/mptcp/mptcp_input.c -index 1e73b4e857f8..b5344c176f75 100644 ---- a/net/mptcp/mptcp_input.c -+++ b/net/mptcp/mptcp_input.c -@@ -1184,7 +1184,6 @@ int mptcp_lookup_join(struct sk_buff *skb, struct inet_timewait_sock *tw) - */ - bh_lock_sock_nested(meta_sk); - if (sock_owned_by_user(meta_sk)) { -- skb->sk = meta_sk; - if (unlikely(sk_add_backlog(meta_sk, skb, - meta_sk->sk_rcvbuf + meta_sk->sk_sndbuf))) { - bh_unlock_sock(meta_sk); -@@ -1257,7 +1256,6 @@ int mptcp_do_join_short(struct sk_buff *skb, - } - - if (sock_owned_by_user(meta_sk)) { -- skb->sk = meta_sk; - if (unlikely(sk_add_backlog(meta_sk, skb, - meta_sk->sk_rcvbuf + meta_sk->sk_sndbuf))) - __NET_INC_STATS(net, LINUX_MIB_TCPBACKLOGDROP); -diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c -index c8a295b0f966..a66920d65b19 100644 ---- a/net/ipv4/tcp_minisocks.c -+++ b/net/ipv4/tcp_minisocks.c -@@ -888,7 +888,7 @@ int tcp_child_process(struct sock *parent, struct sock *child, - * socket does not protect us more. - */ - if (mptcp(tcp_sk(child))) -- skb->sk = child; -+ mptcp_prepare_for_backlog(child, skb); - __sk_add_backlog(meta_sk, skb); - } -