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 0191955b..e792ceac 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,8 +1,7 @@ -diff --git a/linux-4.14.24/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt -index 77f4de5..45f7079 100644 ---- a/linux-4.14.24/Documentation/networking/ip-sysctl.txt -+++ b/Documentation/networking/ip-sysctl.txt -@@ -728,6 +728,18 @@ tcp_challenge_ack_limit - INTEGER +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-16 20:53:41.000000000 +0200 +@@ -728,6 +728,18 @@ in RFC 5961 (Improving TCP's Robustness to Blind In-Window Attacks) Default: 100 @@ -21,11 +20,10 @@ index 77f4de5..45f7079 100644 UDP variables: udp_l3mdev_accept - BOOLEAN -diff --git a/linux-4.14.24/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c -index daf7a56..2c17c2d 100644 ---- a/linux-4.14.24/drivers/infiniband/hw/cxgb4/cm.c -+++ b/drivers/infiniband/hw/cxgb4/cm.c -@@ -3752,7 +3752,7 @@ static void build_cpl_pass_accept_req(struct sk_buff *skb, int stid , u8 tos) +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-16 20:53:41.000000000 +0200 +@@ -3752,7 +3752,7 @@ */ memset(&tmp_opt, 0, sizeof(tmp_opt)); tcp_clear_options(&tmp_opt); @@ -34,11 +32,10 @@ index daf7a56..2c17c2d 100644 req = __skb_push(skb, sizeof(*req)); memset(req, 0, sizeof(*req)); -diff --git a/linux-4.14.24/include/linux/skbuff.h b/include/linux/skbuff.h -index be45224..804bf4f 100644 ---- a/linux-4.14.24/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -684,7 +684,7 @@ struct sk_buff { +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-16 20:53:41.000000000 +0200 +@@ -684,7 +684,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. */ @@ -47,11 +44,10 @@ index be45224..804bf4f 100644 unsigned long _skb_refdst; void (*destructor)(struct sk_buff *skb); -diff --git a/linux-4.14.24/include/linux/tcp.h b/include/linux/tcp.h -index e8418fc..ec862a1 100644 ---- a/linux-4.14.24/include/linux/tcp.h -+++ b/include/linux/tcp.h -@@ -58,7 +58,7 @@ static inline unsigned int tcp_optlen(const 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-16 20:53:41.000000000 +0200 +@@ -58,7 +58,7 @@ /* TCP Fast Open */ #define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */ #define TCP_FASTOPEN_COOKIE_MAX 16 /* Max Fast Open Cookie size in bytes */ @@ -60,7 +56,7 @@ index e8418fc..ec862a1 100644 /* TCP Fast Open Cookie as stored in memory */ struct tcp_fastopen_cookie { -@@ -83,6 +83,56 @@ struct tcp_sack_block { +@@ -83,6 +83,56 @@ u32 end_seq; }; @@ -117,7 +113,7 @@ index e8418fc..ec862a1 100644 /*These are used to set the sack_ok field in struct tcp_options_received */ #define TCP_SACK_SEEN (1 << 0) /*1 = peer is SACK capable, */ #define TCP_FACK_ENABLED (1 << 1) /*1 = FACK is enabled locally*/ -@@ -106,6 +156,9 @@ struct tcp_options_received { +@@ -106,6 +156,9 @@ u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ }; @@ -127,7 +123,7 @@ index e8418fc..ec862a1 100644 static inline void tcp_clear_options(struct tcp_options_received *rx_opt) { rx_opt->tstamp_ok = rx_opt->sack_ok = 0; -@@ -141,6 +194,8 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) +@@ -141,6 +194,8 @@ return (struct tcp_request_sock *)req; } @@ -136,7 +132,7 @@ index e8418fc..ec862a1 100644 struct tcp_sock { /* inet_connection_sock has to be the first member of tcp_sock */ struct inet_connection_sock inet_conn; -@@ -363,6 +418,44 @@ struct tcp_sock { +@@ -363,6 +418,44 @@ */ struct request_sock *fastopen_rsk; u32 *saved_syn; @@ -181,7 +177,7 @@ index e8418fc..ec862a1 100644 }; enum tsq_enum { -@@ -374,6 +467,8 @@ enum tsq_enum { +@@ -374,6 +467,8 @@ TCP_MTU_REDUCED_DEFERRED, /* tcp_v{4|6}_err() could not call * tcp_v{4|6}_mtu_reduced() */ @@ -190,7 +186,7 @@ index e8418fc..ec862a1 100644 }; enum tsq_flags { -@@ -383,6 +478,8 @@ enum tsq_flags { +@@ -383,6 +478,8 @@ TCPF_WRITE_TIMER_DEFERRED = (1UL << TCP_WRITE_TIMER_DEFERRED), TCPF_DELACK_TIMER_DEFERRED = (1UL << TCP_DELACK_TIMER_DEFERRED), TCPF_MTU_REDUCED_DEFERRED = (1UL << TCP_MTU_REDUCED_DEFERRED), @@ -199,7 +195,7 @@ index e8418fc..ec862a1 100644 }; static inline struct tcp_sock *tcp_sk(const struct sock *sk) -@@ -405,6 +502,7 @@ struct tcp_timewait_sock { +@@ -405,6 +502,7 @@ #ifdef CONFIG_TCP_MD5SIG struct tcp_md5sig_key *tw_md5_key; #endif @@ -207,10 +203,9 @@ index e8418fc..ec862a1 100644 }; static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) -diff --git a/linux-4.14.24/include/net/inet_common.h b/include/net/inet_common.h -index 5a54c95..646c9ba 100644 ---- a/linux-4.14.24/include/net/inet_common.h -+++ b/include/net/inet_common.h +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-16 20:53:41.000000000 +0200 @@ -2,6 +2,8 @@ #ifndef _INET_COMMON_H #define _INET_COMMON_H @@ -220,7 +215,7 @@ index 5a54c95..646c9ba 100644 extern const struct proto_ops inet_stream_ops; extern const struct proto_ops inet_dgram_ops; -@@ -14,6 +16,8 @@ struct sock; +@@ -14,6 +16,8 @@ struct sockaddr; struct socket; @@ -229,10 +224,9 @@ index 5a54c95..646c9ba 100644 int inet_release(struct socket *sock); int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags); -diff --git a/linux-4.14.24/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h -index 13e4c89..25c47b8 100644 ---- a/linux-4.14.24/include/net/inet_connection_sock.h -+++ b/include/net/inet_connection_sock.h +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-16 20:53:41.000000000 +0200 @@ -30,6 +30,7 @@ struct inet_bind_bucket; @@ -241,11 +235,10 @@ index 13e4c89..25c47b8 100644 /* * Pointers to address related TCP functions -diff --git a/linux-4.14.24/include/net/inet_sock.h b/include/net/inet_sock.h -index 8e51b4a..0db104a 100644 ---- a/linux-4.14.24/include/net/inet_sock.h -+++ b/include/net/inet_sock.h -@@ -90,7 +90,9 @@ struct inet_request_sock { +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-16 20:53:41.000000000 +0200 +@@ -90,7 +90,9 @@ wscale_ok : 1, ecn_ok : 1, acked : 1, @@ -256,11 +249,9 @@ index 8e51b4a..0db104a 100644 u32 ir_mark; union { struct ip_options_rcu __rcu *ireq_opt; -diff --git a/mptcp/include/net/mptcp.h b/include/net/mptcp.h -new file mode 100644 -index 0000000..ffd1d42 ---- /dev/null -+++ b/include/net/mptcp.h +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,1508 @@ +/* + * MPTCP implementation @@ -1770,11 +1761,9 @@ index 0000000..ffd1d42 +#endif /* CONFIG_MPTCP */ + +#endif /* _MPTCP_H */ -diff --git a/mptcp/include/net/mptcp_v4.h b/include/net/mptcp_v4.h -new file mode 100644 -index 0000000..c83dca0 ---- /dev/null -+++ b/include/net/mptcp_v4.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-16 20:53:41.000000000 +0200 @@ -0,0 +1,68 @@ +/* + * MPTCP implementation @@ -1844,11 +1833,9 @@ index 0000000..c83dca0 +#endif /* CONFIG_MPTCP */ + +#endif /* MPTCP_V4_H_ */ -diff --git a/mptcp/include/net/mptcp_v6.h b/include/net/mptcp_v6.h -new file mode 100644 -index 0000000..a6257fb ---- /dev/null -+++ b/include/net/mptcp_v6.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-16 20:53:41.000000000 +0200 @@ -0,0 +1,69 @@ +/* + * MPTCP implementation @@ -1919,10 +1906,9 @@ index 0000000..a6257fb +#endif /* CONFIG_MPTCP */ + +#endif /* _MPTCP_V6_H */ -diff --git a/linux-4.14.24/include/net/net_namespace.h b/include/net/net_namespace.h -index 0490084..c73723b 100644 ---- a/linux-4.14.24/include/net/net_namespace.h -+++ b/include/net/net_namespace.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-16 20:53:41.000000000 +0200 @@ -18,6 +18,7 @@ #include #include @@ -1931,7 +1917,7 @@ index 0490084..c73723b 100644 #include #include #include -@@ -100,6 +101,9 @@ struct net { +@@ -100,6 +101,9 @@ #if IS_ENABLED(CONFIG_IPV6) struct netns_ipv6 ipv6; #endif @@ -1941,11 +1927,9 @@ index 0490084..c73723b 100644 #if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN) struct netns_ieee802154_lowpan ieee802154_lowpan; #endif -diff --git a/mptcp/include/net/netns/mptcp.h b/include/net/netns/mptcp.h -new file mode 100644 -index 0000000..6680f3b ---- /dev/null -+++ b/include/net/netns/mptcp.h +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,52 @@ +/* + * MPTCP implementation - MPTCP namespace @@ -1999,11 +1983,10 @@ index 0000000..6680f3b +}; + +#endif /* __NETNS_MPTCP_H__ */ -diff --git a/linux-4.14.24/include/net/snmp.h b/include/net/snmp.h -index c9228ad..0d39749 100644 ---- a/linux-4.14.24/include/net/snmp.h -+++ b/include/net/snmp.h -@@ -91,7 +91,6 @@ struct icmpv6msg_mib_device { +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-16 20:53:41.000000000 +0200 +@@ -91,7 +91,6 @@ atomic_long_t mibs[ICMP6MSG_MIB_MAX]; }; @@ -2011,11 +1994,10 @@ index c9228ad..0d39749 100644 /* TCP */ #define TCP_MIB_MAX __TCP_MIB_MAX struct tcp_mib { -diff --git a/linux-4.14.24/include/net/sock.h b/include/net/sock.h -index 9bd5d68..b26cae0 100644 ---- a/linux-4.14.24/include/net/sock.h -+++ b/include/net/sock.h -@@ -771,6 +771,7 @@ enum sock_flags { +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-16 20:53:41.000000000 +0200 +@@ -771,6 +771,7 @@ SOCK_FILTER_LOCKED, /* Filter cannot be changed anymore */ SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */ SOCK_RCU_FREE, /* wait rcu grace period in sk_destruct() */ @@ -2023,7 +2005,7 @@ index 9bd5d68..b26cae0 100644 }; #define SK_FLAGS_TIMESTAMP ((1UL << SOCK_TIMESTAMP) | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)) -@@ -1071,6 +1072,7 @@ struct proto { +@@ -1071,6 +1072,7 @@ void (*unhash)(struct sock *sk); void (*rehash)(struct sock *sk); int (*get_port)(struct sock *sk, unsigned short snum); @@ -2031,11 +2013,10 @@ index 9bd5d68..b26cae0 100644 /* Keeping track of sockets in use */ #ifdef CONFIG_PROC_FS -diff --git a/linux-4.14.24/include/net/tcp.h b/include/net/tcp.h -index 0a13574..4dedf3d 100644 ---- a/linux-4.14.24/include/net/tcp.h -+++ b/include/net/tcp.h -@@ -185,6 +185,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo); +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-16 20:53:41.000000000 +0200 +@@ -185,6 +185,7 @@ #define TCPOPT_SACK 5 /* SACK Block */ #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ #define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ @@ -2043,7 +2024,7 @@ index 0a13574..4dedf3d 100644 #define TCPOPT_FASTOPEN 34 /* Fast open (RFC7413) */ #define TCPOPT_EXP 254 /* Experimental */ /* Magic number to be after the option value for sharing TCP -@@ -238,6 +239,30 @@ void tcp_time_wait(struct sock *sk, int state, int timeo); +@@ -238,6 +239,30 @@ */ #define TFO_SERVER_WO_SOCKOPT1 0x400 @@ -2074,7 +2055,7 @@ index 0a13574..4dedf3d 100644 /* sysctl variables for tcp */ extern int sysctl_tcp_fastopen; -@@ -339,6 +364,97 @@ extern struct proto tcp_prot; +@@ -339,6 +364,97 @@ #define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field) #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) @@ -2172,7 +2153,7 @@ index 0a13574..4dedf3d 100644 void tcp_tasklet_init(void); void tcp_v4_err(struct sk_buff *skb, u32); -@@ -433,7 +549,9 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, +@@ -433,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, @@ -2183,7 +2164,7 @@ index 0a13574..4dedf3d 100644 const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); /* -@@ -442,6 +560,7 @@ const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); +@@ -442,6 +560,7 @@ void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb); void tcp_v4_mtu_reduced(struct sock *sk); @@ -2191,7 +2172,7 @@ index 0a13574..4dedf3d 100644 void tcp_req_err(struct sock *sk, u32 seq, bool abort); int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb); struct sock *tcp_create_openreq_child(const struct sock *sk, -@@ -522,7 +641,8 @@ static inline u32 tcp_cookie_time(void) +@@ -522,7 +641,8 @@ u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, u16 *mssp); @@ -2201,7 +2182,7 @@ index 0a13574..4dedf3d 100644 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 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); +@@ -536,7 +656,8 @@ u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, const struct tcphdr *th, u16 *mssp); @@ -2211,7 +2192,7 @@ index 0a13574..4dedf3d 100644 #endif /* tcp_output.c */ -@@ -567,10 +688,17 @@ bool tcp_schedule_loss_probe(struct sock *sk, bool advancing_rto); +@@ -567,10 +688,17 @@ void tcp_skb_collapse_tstamp(struct sk_buff *skb, const struct sk_buff *next_skb); @@ -2229,7 +2210,7 @@ index 0a13574..4dedf3d 100644 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 @@ struct tcp_skb_cb { +@@ -803,6 +931,12 @@ */ ktime_t swtstamp; }; @@ -2242,7 +2223,7 @@ index 0a13574..4dedf3d 100644 __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ __u8 sacked; /* State flags for SACK/FACK. */ -@@ -821,6 +955,14 @@ struct tcp_skb_cb { +@@ -821,6 +955,14 @@ has_rxtstamp:1, /* SKB has a RX timestamp */ unused:5; __u32 ack_seq; /* Sequence number ACK'd */ @@ -2257,7 +2238,7 @@ index 0a13574..4dedf3d 100644 union { struct { /* There is space for up to 24 bytes */ -@@ -1319,7 +1461,8 @@ static inline void tcp_slow_start_after_idle_check(struct sock *sk) +@@ -1319,7 +1461,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, @@ -2267,7 +2248,7 @@ index 0a13574..4dedf3d 100644 static inline int tcp_win_from_space(int space) { -@@ -1330,6 +1473,19 @@ static inline int tcp_win_from_space(int space) +@@ -1330,6 +1473,19 @@ space - (space>>tcp_adv_win_scale); } @@ -2287,7 +2268,7 @@ index 0a13574..4dedf3d 100644 /* Note: caller must be prepared to deal with negative returns */ static inline int tcp_space(const struct sock *sk) { -@@ -1878,6 +2034,30 @@ struct tcp_sock_af_ops { +@@ -1880,6 +2036,30 @@ #endif }; @@ -2318,7 +2299,7 @@ index 0a13574..4dedf3d 100644 struct tcp_request_sock_ops { u16 mss_clamp; #ifdef CONFIG_TCP_MD5SIG -@@ -1888,12 +2068,13 @@ struct tcp_request_sock_ops { +@@ -1890,12 +2070,13 @@ const struct sock *sk, const struct sk_buff *skb); #endif @@ -2337,7 +2318,7 @@ index 0a13574..4dedf3d 100644 #endif struct dst_entry *(*route_req)(const struct sock *sk, struct flowi *fl, const struct request_sock *req); -@@ -1907,15 +2088,17 @@ struct tcp_request_sock_ops { +@@ -1909,15 +2090,17 @@ #ifdef CONFIG_SYN_COOKIES static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops, @@ -2356,11 +2337,10 @@ index 0a13574..4dedf3d 100644 const struct sock *sk, struct sk_buff *skb, __u16 *mss) { -diff --git a/linux-4.14.24/include/net/tcp_states.h b/include/net/tcp_states.h -index 50e78a7..aa76153 100644 ---- a/linux-4.14.24/include/net/tcp_states.h -+++ b/include/net/tcp_states.h -@@ -26,6 +26,7 @@ enum { +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-16 20:53:41.000000000 +0200 +@@ -26,6 +26,7 @@ TCP_LISTEN, TCP_CLOSING, /* Now a valid state */ TCP_NEW_SYN_RECV, @@ -2368,7 +2348,7 @@ index 50e78a7..aa76153 100644 TCP_MAX_STATES /* Leave at the end! */ }; -@@ -47,6 +48,7 @@ enum { +@@ -47,6 +48,7 @@ TCPF_LISTEN = (1 << 10), TCPF_CLOSING = (1 << 11), TCPF_NEW_SYN_RECV = (1 << 12), @@ -2376,11 +2356,10 @@ index 50e78a7..aa76153 100644 }; #endif /* _LINUX_TCP_STATES_H */ -diff --git a/linux-4.14.24/include/net/transp_v6.h b/include/net/transp_v6.h -index c4f5caa..e9e13d3 100644 ---- a/linux-4.14.24/include/net/transp_v6.h -+++ b/include/net/transp_v6.h -@@ -52,6 +52,8 @@ void ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp, +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-16 20:53:41.000000000 +0200 +@@ -52,6 +52,8 @@ /* address family specific functions */ extern const struct inet_connection_sock_af_ops ipv4_specific; @@ -2389,11 +2368,10 @@ index c4f5caa..e9e13d3 100644 void inet6_destroy_sock(struct sock *sk); -diff --git a/linux-4.14.24/include/uapi/linux/if.h b/include/uapi/linux/if.h -index 7fea0fd..7255e08 100644 ---- a/linux-4.14.24/include/uapi/linux/if.h -+++ b/include/uapi/linux/if.h -@@ -132,6 +132,9 @@ enum net_device_flags { +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-16 20:53:41.000000000 +0200 +@@ -132,6 +132,9 @@ #define IFF_ECHO IFF_ECHO #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ @@ -2403,10 +2381,9 @@ index 7fea0fd..7255e08 100644 #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\ IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) -diff --git a/linux-4.14.24/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h -index 6a64bee..d9abf0d 100644 ---- a/linux-4.14.24/include/uapi/linux/tcp.h -+++ b/include/uapi/linux/tcp.h +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-16 20:53:41.000000000 +0200 @@ -18,9 +18,15 @@ #ifndef _UAPI_LINUX_TCP_H #define _UAPI_LINUX_TCP_H @@ -2424,7 +2401,7 @@ index 6a64bee..d9abf0d 100644 struct tcphdr { __be16 source; -@@ -120,6 +126,12 @@ enum { +@@ -120,6 +126,12 @@ #define TCP_FASTOPEN_CONNECT 30 /* Attempt FastOpen with connect */ #define TCP_ULP 31 /* Attach a ULP to a TCP connection */ #define TCP_MD5SIG_EXT 32 /* TCP MD5 Signature with extensions */ @@ -2437,7 +2414,7 @@ index 6a64bee..d9abf0d 100644 struct tcp_repair_opt { __u32 opt_code; -@@ -242,6 +254,53 @@ enum { +@@ -242,6 +254,53 @@ }; @@ -2491,35 +2468,10 @@ index 6a64bee..d9abf0d 100644 /* for TCP_MD5SIG socket option */ #define TCP_MD5SIG_MAXKEYLEN 80 -diff --git a/linux-4.14.24/net/Kconfig b/net/Kconfig -index 9dba271..009ec21 100644 ---- a/linux-4.14.24/net/Kconfig -+++ b/net/Kconfig -@@ -88,6 +88,7 @@ if INET - source "net/ipv4/Kconfig" - source "net/ipv6/Kconfig" - source "net/netlabel/Kconfig" -+source "net/mptcp/Kconfig" - - endif # if INET - -diff --git a/linux-4.14.24/net/Makefile b/net/Makefile -index 14fede5..4d9fb91 100644 ---- a/linux-4.14.24/net/Makefile -+++ b/net/Makefile -@@ -20,6 +20,7 @@ obj-$(CONFIG_TLS) += tls/ - obj-$(CONFIG_XFRM) += xfrm/ - obj-$(CONFIG_UNIX) += unix/ - obj-$(CONFIG_NET) += ipv6/ -+obj-$(CONFIG_MPTCP) += mptcp/ - obj-$(CONFIG_PACKET) += packet/ - obj-$(CONFIG_NET_KEY) += key/ - obj-$(CONFIG_BRIDGE) += bridge/ -diff --git a/linux-4.14.24/net/core/dev.c b/net/core/dev.c -index d33bbed..62e7770 100644 ---- a/linux-4.14.24/net/core/dev.c -+++ b/net/core/dev.c -@@ -6725,7 +6725,7 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags) +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-16 20:53:41.000000000 +0200 +@@ -6740,7 +6740,7 @@ dev->flags = (flags & (IFF_DEBUG | IFF_NOTRAILERS | IFF_NOARP | IFF_DYNAMIC | IFF_MULTICAST | IFF_PORTSEL | @@ -2528,11 +2480,10 @@ index d33bbed..62e7770 100644 (dev->flags & (IFF_UP | IFF_VOLATILE | IFF_PROMISC | IFF_ALLMULTI)); -diff --git a/linux-4.14.24/net/core/skbuff.c b/net/core/skbuff.c -index cc811ad..21a6b49 100644 ---- a/linux-4.14.24/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -532,7 +532,7 @@ static inline void skb_drop_fraglist(struct sk_buff *skb) +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-16 20:53:41.000000000 +0200 +@@ -532,7 +532,7 @@ skb_drop_list(&skb_shinfo(skb)->frag_list); } @@ -2541,7 +2492,7 @@ index cc811ad..21a6b49 100644 { struct sk_buff *list; -@@ -1302,7 +1302,7 @@ static void skb_headers_offset_update(struct sk_buff *skb, int off) +@@ -1303,7 +1303,7 @@ skb->inner_mac_header += off; } @@ -2550,10 +2501,9 @@ index cc811ad..21a6b49 100644 { __copy_skb_header(new, old); -diff --git a/linux-4.14.24/net/core/sock.c b/net/core/sock.c -index ec6eb54..e8fee0a 100644 ---- a/linux-4.14.24/net/core/sock.c -+++ b/net/core/sock.c +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-16 20:53:41.000000000 +0200 @@ -139,6 +139,11 @@ #include @@ -2566,7 +2516,7 @@ index ec6eb54..e8fee0a 100644 #include #include -@@ -1415,6 +1420,23 @@ lenout: +@@ -1415,6 +1420,23 @@ */ static inline void sock_lock_init(struct sock *sk) { @@ -2590,7 +2540,7 @@ index ec6eb54..e8fee0a 100644 if (sk->sk_kern_sock) sock_lock_init_class_and_name( sk, -@@ -1463,8 +1485,12 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, +@@ -1463,8 +1485,12 @@ sk = kmem_cache_alloc(slab, priority & ~__GFP_ZERO); if (!sk) return sk; @@ -2605,7 +2555,7 @@ index ec6eb54..e8fee0a 100644 } else sk = kmalloc(prot->obj_size, priority); -@@ -1681,6 +1707,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) +@@ -1681,6 +1707,7 @@ atomic_set(&newsk->sk_zckey, 0); sock_reset_flag(newsk, SOCK_DONE); @@ -2613,11 +2563,161 @@ index ec6eb54..e8fee0a 100644 mem_cgroup_sk_alloc(newsk); cgroup_sk_alloc(&newsk->sk_cgrp_data); -diff --git a/linux-4.14.24/net/ipv4/Kconfig b/net/ipv4/Kconfig -index f48fe6f..93def62 100644 ---- a/linux-4.14.24/net/ipv4/Kconfig -+++ b/net/ipv4/Kconfig -@@ -675,6 +675,38 @@ config TCP_CONG_BBR +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-16 20:53:41.000000000 +0200 +@@ -104,6 +104,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -149,6 +150,9 @@ + return; + } + ++ if (sock_flag(sk, SOCK_MPTCP)) ++ mptcp_disable_static_key(); ++ + WARN_ON(atomic_read(&sk->sk_rmem_alloc)); + WARN_ON(refcount_read(&sk->sk_wmem_alloc)); + WARN_ON(sk->sk_wmem_queued); +@@ -241,8 +245,7 @@ + * Create an inet socket. + */ + +-static int inet_create(struct net *net, struct socket *sock, int protocol, +- int kern) ++int inet_create(struct net *net, struct socket *sock, int protocol, int kern) + { + struct sock *sk; + struct inet_protosw *answer; +@@ -702,6 +705,23 @@ + lock_sock(sk2); + + sock_rps_record_flow(sk2); ++ ++ if (sk2->sk_protocol == IPPROTO_TCP && mptcp(tcp_sk(sk2))) { ++ struct sock *sk_it = sk2; ++ ++ mptcp_for_each_sk(tcp_sk(sk2)->mpcb, sk_it) ++ sock_rps_record_flow(sk_it); ++ ++ if (tcp_sk(sk2)->mpcb->master_sk) { ++ sk_it = tcp_sk(sk2)->mpcb->master_sk; ++ ++ write_lock_bh(&sk_it->sk_callback_lock); ++ sk_it->sk_wq = newsock->wq; ++ sk_it->sk_socket = newsock; ++ write_unlock_bh(&sk_it->sk_callback_lock); ++ } ++ } ++ + WARN_ON(!((1 << sk2->sk_state) & + (TCPF_ESTABLISHED | TCPF_SYN_RECV | + TCPF_CLOSE_WAIT | TCPF_CLOSE))); +@@ -1882,6 +1902,9 @@ + + ip_init(); + ++ /* We must initialize MPTCP before TCP. */ ++ mptcp_init(); ++ + /* 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-16 20:53:41.000000000 +0200 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -686,7 +687,10 @@ + int max_retries, thresh; + u8 defer_accept; + +- if (sk_state_load(sk_listener) != TCP_LISTEN) ++ if (sk_state_load(sk_listener) != TCP_LISTEN && !is_meta_sk(sk_listener)) ++ goto drop; ++ ++ if (is_meta_sk(sk_listener) && !mptcp_can_new_subflow(sk_listener)) + goto drop; + + max_retries = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_synack_retries; +@@ -780,7 +784,9 @@ + const struct request_sock *req, + const gfp_t priority) + { +- struct sock *newsk = sk_clone_lock(sk, priority); ++ struct sock *newsk; ++ ++ newsk = sk_clone_lock(sk, priority); + + if (newsk) { + struct inet_connection_sock *newicsk = inet_csk(newsk); +@@ -980,7 +986,12 @@ + */ + while ((req = reqsk_queue_remove(queue, sk)) != NULL) { + struct sock *child = req->sk; ++ bool mutex_taken = false; + ++ if (is_meta_sk(child)) { ++ mutex_lock(&tcp_sk(child)->mpcb->mpcb_mutex); ++ mutex_taken = true; ++ } + local_bh_disable(); + bh_lock_sock(child); + WARN_ON(sock_owned_by_user(child)); +@@ -990,6 +1001,8 @@ + reqsk_put(req); + bh_unlock_sock(child); + local_bh_enable(); ++ if (mutex_taken) ++ mutex_unlock(&tcp_sk(child)->mpcb->mpcb_mutex); + 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-16 20:53:41.000000000 +0200 +@@ -44,6 +44,8 @@ + #endif + #include + ++#include ++ + #include + #include + +@@ -754,6 +756,17 @@ + inet->tos = val; + sk->sk_priority = rt_tos2priority(val); + sk_dst_reset(sk); ++ /* Update TOS on mptcp subflow */ ++ if (is_meta_sk(sk)) { ++ struct sock *sk_it; ++ mptcp_for_each_sk(tcp_sk(sk)->mpcb, sk_it) { ++ if (inet_sk(sk_it)->tos != inet_sk(sk)->tos) { ++ inet_sk(sk_it)->tos = inet_sk(sk)->tos; ++ sk_it->sk_priority = sk->sk_priority; ++ sk_dst_reset(sk_it); ++ } ++ } ++ } + } + break; + case IP_TTL: +diff -aurN linux-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-16 20:53:41.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. @@ -2656,7 +2756,7 @@ index f48fe6f..93def62 100644 choice prompt "Default TCP congestion control" default DEFAULT_CUBIC -@@ -712,6 +744,18 @@ choice +@@ -712,6 +744,18 @@ config DEFAULT_BBR bool "BBR" if TCP_CONG_BBR=y @@ -2675,7 +2775,7 @@ index f48fe6f..93def62 100644 config DEFAULT_RENO bool "Reno" endchoice -@@ -732,6 +776,10 @@ config DEFAULT_TCP_CONG +@@ -732,6 +776,10 @@ default "vegas" if DEFAULT_VEGAS default "westwood" if DEFAULT_WESTWOOD default "veno" if DEFAULT_VENO @@ -2686,164 +2786,9 @@ index f48fe6f..93def62 100644 default "reno" if DEFAULT_RENO default "dctcp" if DEFAULT_DCTCP default "cdg" if DEFAULT_CDG -diff --git a/linux-4.14.24/net/ipv4/af_inet.c b/net/ipv4/af_inet.c -index b9d9a2b..884e505 100644 ---- a/linux-4.14.24/net/ipv4/af_inet.c -+++ b/net/ipv4/af_inet.c -@@ -104,6 +104,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -149,6 +150,9 @@ void inet_sock_destruct(struct sock *sk) - return; - } - -+ if (sock_flag(sk, SOCK_MPTCP)) -+ mptcp_disable_static_key(); -+ - WARN_ON(atomic_read(&sk->sk_rmem_alloc)); - WARN_ON(refcount_read(&sk->sk_wmem_alloc)); - WARN_ON(sk->sk_wmem_queued); -@@ -241,8 +245,7 @@ EXPORT_SYMBOL(inet_listen); - * Create an inet socket. - */ - --static int inet_create(struct net *net, struct socket *sock, int protocol, -- int kern) -+int inet_create(struct net *net, struct socket *sock, int protocol, int kern) - { - struct sock *sk; - struct inet_protosw *answer; -@@ -702,6 +705,23 @@ int inet_accept(struct socket *sock, struct socket *newsock, int flags, - lock_sock(sk2); - - sock_rps_record_flow(sk2); -+ -+ if (sk2->sk_protocol == IPPROTO_TCP && mptcp(tcp_sk(sk2))) { -+ struct sock *sk_it = sk2; -+ -+ mptcp_for_each_sk(tcp_sk(sk2)->mpcb, sk_it) -+ sock_rps_record_flow(sk_it); -+ -+ if (tcp_sk(sk2)->mpcb->master_sk) { -+ sk_it = tcp_sk(sk2)->mpcb->master_sk; -+ -+ write_lock_bh(&sk_it->sk_callback_lock); -+ sk_it->sk_wq = newsock->wq; -+ sk_it->sk_socket = newsock; -+ write_unlock_bh(&sk_it->sk_callback_lock); -+ } -+ } -+ - WARN_ON(!((1 << sk2->sk_state) & - (TCPF_ESTABLISHED | TCPF_SYN_RECV | - TCPF_CLOSE_WAIT | TCPF_CLOSE))); -@@ -1882,6 +1902,9 @@ static int __init inet_init(void) - - ip_init(); - -+ /* We must initialize MPTCP before TCP. */ -+ mptcp_init(); -+ - /* Setup TCP slab cache for open requests. */ - tcp_init(); - -diff --git a/linux-4.14.24/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c -index 0cc08c5..fcc90f8 100644 ---- a/linux-4.14.24/net/ipv4/inet_connection_sock.c -+++ b/net/ipv4/inet_connection_sock.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -686,7 +687,10 @@ static void reqsk_timer_handler(unsigned long data) - int max_retries, thresh; - u8 defer_accept; - -- if (sk_state_load(sk_listener) != TCP_LISTEN) -+ if (sk_state_load(sk_listener) != TCP_LISTEN && !is_meta_sk(sk_listener)) -+ goto drop; -+ -+ if (is_meta_sk(sk_listener) && !mptcp_can_new_subflow(sk_listener)) - goto drop; - - max_retries = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_synack_retries; -@@ -780,7 +784,9 @@ struct sock *inet_csk_clone_lock(const struct sock *sk, - const struct request_sock *req, - const gfp_t priority) - { -- struct sock *newsk = sk_clone_lock(sk, priority); -+ struct sock *newsk; -+ -+ newsk = sk_clone_lock(sk, priority); - - if (newsk) { - struct inet_connection_sock *newicsk = inet_csk(newsk); -@@ -980,7 +986,12 @@ void inet_csk_listen_stop(struct sock *sk) - */ - while ((req = reqsk_queue_remove(queue, sk)) != NULL) { - struct sock *child = req->sk; -+ bool mutex_taken = false; - -+ if (is_meta_sk(child)) { -+ mutex_lock(&tcp_sk(child)->mpcb->mpcb_mutex); -+ mutex_taken = true; -+ } - local_bh_disable(); - bh_lock_sock(child); - WARN_ON(sock_owned_by_user(child)); -@@ -990,6 +1001,8 @@ void inet_csk_listen_stop(struct sock *sk) - reqsk_put(req); - bh_unlock_sock(child); - local_bh_enable(); -+ if (mutex_taken) -+ mutex_unlock(&tcp_sk(child)->mpcb->mpcb_mutex); - sock_put(child); - - cond_resched(); -diff --git a/linux-4.14.24/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c -index f56aab5..a8d6fb9 100644 ---- a/linux-4.14.24/net/ipv4/ip_sockglue.c -+++ b/net/ipv4/ip_sockglue.c -@@ -44,6 +44,8 @@ - #endif - #include - -+#include -+ - #include - #include - -@@ -752,6 +754,17 @@ static int do_ip_setsockopt(struct sock *sk, int level, - inet->tos = val; - sk->sk_priority = rt_tos2priority(val); - sk_dst_reset(sk); -+ /* Update TOS on mptcp subflow */ -+ if (is_meta_sk(sk)) { -+ struct sock *sk_it; -+ mptcp_for_each_sk(tcp_sk(sk)->mpcb, sk_it) { -+ if (inet_sk(sk_it)->tos != inet_sk(sk)->tos) { -+ inet_sk(sk_it)->tos = inet_sk(sk)->tos; -+ sk_it->sk_priority = sk->sk_priority; -+ sk_dst_reset(sk_it); -+ } -+ } -+ } - } - break; - case IP_TTL: -diff --git a/linux-4.14.24/net/ipv4/syncookies.c b/net/ipv4/syncookies.c -index 77cf32a..230202c 100644 ---- a/linux-4.14.24/net/ipv4/syncookies.c -+++ b/net/ipv4/syncookies.c +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-16 20:53:41.000000000 +0200 @@ -16,6 +16,8 @@ #include #include @@ -2853,7 +2798,7 @@ index 77cf32a..230202c 100644 #include #include #include -@@ -179,7 +181,8 @@ u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, +@@ -179,7 +181,8 @@ } EXPORT_SYMBOL_GPL(__cookie_v4_init_sequence); @@ -2863,7 +2808,7 @@ index 77cf32a..230202c 100644 { const struct iphdr *iph = ip_hdr(skb); const struct tcphdr *th = tcp_hdr(skb); -@@ -209,9 +212,27 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb, +@@ -209,9 +212,27 @@ struct inet_connection_sock *icsk = inet_csk(sk); struct sock *child; bool own_req; @@ -2891,7 +2836,7 @@ index 77cf32a..230202c 100644 if (child) { refcount_set(&req->rsk_refcnt, 1); tcp_sk(child)->tsoffset = tsoff; -@@ -284,6 +305,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -284,6 +305,7 @@ { struct ip_options *opt = &TCP_SKB_CB(skb)->header.h4.opt; struct tcp_options_received tcp_opt; @@ -2899,7 +2844,7 @@ index 77cf32a..230202c 100644 struct inet_request_sock *ireq; struct tcp_request_sock *treq; struct tcp_sock *tp = tcp_sk(sk); -@@ -313,7 +335,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -313,7 +335,8 @@ /* check for timestamp cookie support */ memset(&tcp_opt, 0, sizeof(tcp_opt)); @@ -2909,7 +2854,7 @@ index 77cf32a..230202c 100644 if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) { tsoff = secure_tcp_ts_off(sock_net(sk), -@@ -326,7 +349,12 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -326,7 +349,12 @@ goto out; ret = NULL; @@ -2923,7 +2868,7 @@ index 77cf32a..230202c 100644 if (!req) goto out; -@@ -346,12 +374,17 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -346,12 +374,17 @@ ireq->sack_ok = tcp_opt.sack_ok; ireq->wscale_ok = tcp_opt.wscale_ok; ireq->tstamp_ok = tcp_opt.saw_tstamp; @@ -2941,7 +2886,7 @@ index 77cf32a..230202c 100644 /* We throwed the options of the initial SYN away, so we hope * the ACK carries the same options again (see RFC1122 4.2.3.8) */ -@@ -385,10 +418,10 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) +@@ -385,10 +418,10 @@ /* Try to redo what tcp_v4_send_synack did. */ req->rsk_window_clamp = tp->window_clamp ? :dst_metric(&rt->dst, RTAX_WINDOW); @@ -2956,10 +2901,9 @@ index 77cf32a..230202c 100644 ireq->rcv_wscale = rcv_wscale; ireq->ecn_ok = cookie_ecn_ok(&tcp_opt, sock_net(sk), &rt->dst); -diff --git a/linux-4.14.24/net/ipv4/tcp.c b/net/ipv4/tcp.c -index fe11128..f5c905d 100644 ---- a/linux-4.14.24/net/ipv4/tcp.c -+++ b/net/ipv4/tcp.c +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-16 20:53:41.000000000 +0200 @@ -273,6 +273,7 @@ #include @@ -2968,7 +2912,7 @@ index fe11128..f5c905d 100644 #include #include #include -@@ -402,6 +403,24 @@ static u64 tcp_compute_delivery_rate(const struct tcp_sock *tp) +@@ -402,6 +403,24 @@ return rate64; } @@ -2993,7 +2937,7 @@ index fe11128..f5c905d 100644 /* Address-family independent initialization for a tcp_sock. * * NOTE: A lot of things set to zero explicitly by call to -@@ -452,6 +471,11 @@ void tcp_init_sock(struct sock *sk) +@@ -452,6 +471,11 @@ sk->sk_sndbuf = sysctl_tcp_wmem[1]; sk->sk_rcvbuf = sysctl_tcp_rmem[1]; @@ -3005,7 +2949,7 @@ index fe11128..f5c905d 100644 sk_sockets_allocated_inc(sk); } EXPORT_SYMBOL(tcp_init_sock); -@@ -766,6 +790,14 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, +@@ -766,6 +790,14 @@ int ret; sock_rps_record_flow(sk); @@ -3020,7 +2964,7 @@ index fe11128..f5c905d 100644 /* * We can't seek on a socket input */ -@@ -879,8 +911,7 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp, +@@ -879,8 +911,7 @@ return NULL; } @@ -3030,7 +2974,7 @@ index fe11128..f5c905d 100644 { struct tcp_sock *tp = tcp_sk(sk); u32 new_size_goal, size_goal; -@@ -908,8 +939,13 @@ static int tcp_send_mss(struct sock *sk, int *size_goal, int flags) +@@ -908,8 +939,13 @@ { int mss_now; @@ -3046,7 +2990,7 @@ index fe11128..f5c905d 100644 return mss_now; } -@@ -928,12 +964,33 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, +@@ -928,12 +964,33 @@ * is fully established. */ if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) && @@ -3081,7 +3025,7 @@ index fe11128..f5c905d 100644 sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk); mss_now = tcp_send_mss(sk, &size_goal, flags); -@@ -1050,8 +1107,9 @@ EXPORT_SYMBOL_GPL(do_tcp_sendpages); +@@ -1050,8 +1107,9 @@ int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset, size_t size, int flags) { @@ -3093,7 +3037,7 @@ index fe11128..f5c905d 100644 return sock_no_sendpage_locked(sk, page, offset, size, flags); tcp_rate_check_app_limited(sk); /* is sending application-limited? */ -@@ -1083,14 +1141,14 @@ EXPORT_SYMBOL(tcp_sendpage); +@@ -1083,14 +1141,14 @@ * This also speeds up tso_fragment(), since it wont fallback * to tcp_fragment(). */ @@ -3110,7 +3054,7 @@ index fe11128..f5c905d 100644 { const struct tcp_sock *tp = tcp_sk(sk); int tmp = tp->mss_cache; -@@ -1211,12 +1269,19 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) +@@ -1211,12 +1269,19 @@ * is fully established. */ if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) && @@ -3131,7 +3075,7 @@ index fe11128..f5c905d 100644 if (unlikely(tp->repair)) { if (tp->repair_queue == TCP_RECV_QUEUE) { copied = tcp_send_rcvq(sk, msg, size); -@@ -1252,7 +1317,10 @@ restart: +@@ -1252,7 +1317,10 @@ if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN)) goto do_error; @@ -3143,7 +3087,7 @@ index fe11128..f5c905d 100644 while (msg_data_left(msg)) { int copy = 0; -@@ -1281,7 +1349,7 @@ new_segment: +@@ -1281,7 +1349,7 @@ } first_skb = skb_queue_empty(&sk->sk_write_queue); skb = sk_stream_alloc_skb(sk, @@ -3152,7 +3096,7 @@ index fe11128..f5c905d 100644 sk->sk_allocation, first_skb); if (!skb) -@@ -1290,8 +1358,15 @@ new_segment: +@@ -1290,8 +1358,15 @@ process_backlog = true; /* * Check whether we can use HW checksum. @@ -3169,7 +3113,7 @@ index fe11128..f5c905d 100644 skb->ip_summed = CHECKSUM_PARTIAL; skb_entail(sk, skb); -@@ -1522,7 +1597,7 @@ static int tcp_peek_sndq(struct sock *sk, struct msghdr *msg, int len) +@@ -1522,7 +1597,7 @@ * calculation of whether or not we must ACK for the sake of * a window update. */ @@ -3178,7 +3122,7 @@ index fe11128..f5c905d 100644 { struct tcp_sock *tp = tcp_sk(sk); bool time_to_ack = false; -@@ -1565,7 +1640,7 @@ static void tcp_cleanup_rbuf(struct sock *sk, int copied) +@@ -1565,7 +1640,7 @@ /* Optimize, __tcp_select_window() is not cheap. */ if (2*rcv_window_now <= tp->window_clamp) { @@ -3187,7 +3131,7 @@ index fe11128..f5c905d 100644 /* Send ACK now, if this read freed lots of space * in our buffer. Certainly, new_window is new window. -@@ -1681,7 +1756,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, +@@ -1681,7 +1756,7 @@ /* Clean up data we have read: This will do ACK frames. */ if (copied > 0) { tcp_recv_skb(sk, seq, &offset); @@ -3196,7 +3140,7 @@ index fe11128..f5c905d 100644 } return copied; } -@@ -1781,6 +1856,14 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, +@@ -1781,6 +1856,14 @@ lock_sock(sk); @@ -3211,7 +3155,7 @@ index fe11128..f5c905d 100644 err = -ENOTCONN; if (sk->sk_state == TCP_LISTEN) goto out; -@@ -1901,7 +1984,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, +@@ -1901,7 +1984,7 @@ } } @@ -3220,7 +3164,7 @@ index fe11128..f5c905d 100644 if (copied >= target) { /* Do not sleep, just process backlog. */ -@@ -1994,7 +2077,7 @@ skip_copy: +@@ -1994,7 +2077,7 @@ tcp_recv_timestamp(msg, sk, &tss); /* Clean up data we have read: This will do ACK frames. */ @@ -3229,7 +3173,7 @@ index fe11128..f5c905d 100644 release_sock(sk); return copied; -@@ -2072,7 +2155,7 @@ static const unsigned char new_state[16] = { +@@ -2072,7 +2155,7 @@ [TCP_NEW_SYN_RECV] = TCP_CLOSE, /* should not happen ! */ }; @@ -3238,7 +3182,7 @@ index fe11128..f5c905d 100644 { int next = (int)new_state[sk->sk_state]; int ns = next & TCP_STATE_MASK; -@@ -2102,7 +2185,7 @@ void tcp_shutdown(struct sock *sk, int how) +@@ -2102,7 +2185,7 @@ TCPF_SYN_RECV | TCPF_CLOSE_WAIT)) { /* Clear out any half completed packets. FIN if needed. */ if (tcp_close_state(sk)) @@ -3247,7 +3191,7 @@ index fe11128..f5c905d 100644 } } EXPORT_SYMBOL(tcp_shutdown); -@@ -2127,6 +2210,11 @@ void tcp_close(struct sock *sk, long timeout) +@@ -2127,6 +2210,11 @@ int data_was_unread = 0; int state; @@ -3259,7 +3203,7 @@ index fe11128..f5c905d 100644 lock_sock(sk); sk->sk_shutdown = SHUTDOWN_MASK; -@@ -2171,7 +2259,7 @@ void tcp_close(struct sock *sk, long timeout) +@@ -2171,7 +2259,7 @@ /* Unread data was tossed, zap the connection. */ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONCLOSE); tcp_set_state(sk, TCP_CLOSE); @@ -3268,7 +3212,7 @@ index fe11128..f5c905d 100644 } else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) { /* Check zero linger _after_ checking for unread data. */ sk->sk_prot->disconnect(sk, 0); -@@ -2251,7 +2339,7 @@ adjudge_to_death: +@@ -2251,7 +2339,7 @@ struct tcp_sock *tp = tcp_sk(sk); if (tp->linger2 < 0) { tcp_set_state(sk, TCP_CLOSE); @@ -3277,7 +3221,7 @@ index fe11128..f5c905d 100644 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONLINGER); } else { -@@ -2261,7 +2349,8 @@ adjudge_to_death: +@@ -2261,7 +2349,8 @@ inet_csk_reset_keepalive_timer(sk, tmo - TCP_TIMEWAIT_LEN); } else { @@ -3287,7 +3231,7 @@ index fe11128..f5c905d 100644 goto out; } } -@@ -2270,7 +2359,7 @@ adjudge_to_death: +@@ -2270,7 +2359,7 @@ sk_mem_reclaim(sk); if (tcp_check_oom(sk, 0)) { tcp_set_state(sk, TCP_CLOSE); @@ -3296,7 +3240,7 @@ index fe11128..f5c905d 100644 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY); } else if (!check_net(sock_net(sk))) { -@@ -2298,15 +2387,6 @@ out: +@@ -2298,15 +2387,6 @@ } EXPORT_SYMBOL(tcp_close); @@ -3312,7 +3256,7 @@ index fe11128..f5c905d 100644 int tcp_disconnect(struct sock *sk, int flags) { struct inet_sock *inet = inet_sk(sk); -@@ -2329,7 +2409,7 @@ int tcp_disconnect(struct sock *sk, int flags) +@@ -2329,7 +2409,7 @@ /* The last check adjusts for discrepancy of Linux wrt. RFC * states */ @@ -3321,7 +3265,7 @@ index fe11128..f5c905d 100644 sk->sk_err = ECONNRESET; } else if (old_state == TCP_SYN_SENT) sk->sk_err = ECONNRESET; -@@ -2345,6 +2425,13 @@ int tcp_disconnect(struct sock *sk, int flags) +@@ -2345,6 +2425,13 @@ if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK)) inet_reset_saddr(sk); @@ -3335,7 +3279,7 @@ index fe11128..f5c905d 100644 sk->sk_shutdown = 0; sock_reset_flag(sk, SOCK_DONE); tp->srtt_us = 0; -@@ -2528,6 +2615,61 @@ static int do_tcp_setsockopt(struct sock *sk, int level, +@@ -2527,6 +2614,61 @@ release_sock(sk); return err; } @@ -3397,7 +3341,7 @@ index fe11128..f5c905d 100644 default: /* fallthru */ break; -@@ -2705,6 +2847,12 @@ static int do_tcp_setsockopt(struct sock *sk, int level, +@@ -2704,6 +2846,12 @@ break; case TCP_DEFER_ACCEPT: @@ -3410,7 +3354,7 @@ index fe11128..f5c905d 100644 /* Translate value in seconds to number of retransmits */ icsk->icsk_accept_queue.rskq_defer_accept = secs_to_retrans(val, TCP_TIMEOUT_INIT / HZ, -@@ -2732,7 +2880,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, +@@ -2731,7 +2879,7 @@ (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT) && inet_csk_ack_scheduled(sk)) { icsk->icsk_ack.pending |= ICSK_ACK_PUSHED; @@ -3419,7 +3363,7 @@ index fe11128..f5c905d 100644 if (!(val & 1)) icsk->icsk_ack.pingpong = 1; } -@@ -2791,6 +2939,28 @@ static int do_tcp_setsockopt(struct sock *sk, int level, +@@ -2792,6 +2940,28 @@ tp->notsent_lowat = val; sk->sk_write_space(sk); break; @@ -3448,7 +3392,7 @@ index fe11128..f5c905d 100644 default: err = -ENOPROTOOPT; break; -@@ -3218,6 +3388,75 @@ static int do_tcp_getsockopt(struct sock *sk, int level, +@@ -3219,6 +3389,75 @@ } return 0; } @@ -3524,7 +3468,7 @@ index fe11128..f5c905d 100644 default: return -ENOPROTOOPT; } -@@ -3392,7 +3631,9 @@ void tcp_done(struct sock *sk) +@@ -3393,7 +3632,9 @@ if (sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV) TCP_INC_STATS(sock_net(sk), TCP_MIB_ATTEMPTFAILS); @@ -3534,7 +3478,7 @@ index fe11128..f5c905d 100644 tcp_clear_xmit_timers(sk); if (req) reqsk_fastopen_remove(sk, req, false); -@@ -3408,6 +3649,8 @@ EXPORT_SYMBOL_GPL(tcp_done); +@@ -3409,6 +3650,8 @@ int tcp_abort(struct sock *sk, int err) { @@ -3543,7 +3487,7 @@ index fe11128..f5c905d 100644 if (!sk_fullsock(sk)) { if (sk->sk_state == TCP_NEW_SYN_RECV) { struct request_sock *req = inet_reqsk(sk); -@@ -3422,7 +3665,7 @@ int tcp_abort(struct sock *sk, int err) +@@ -3423,7 +3666,7 @@ } /* Don't race with userspace socket closes such as tcp_close. */ @@ -3552,7 +3496,7 @@ index fe11128..f5c905d 100644 if (sk->sk_state == TCP_LISTEN) { tcp_set_state(sk, TCP_CLOSE); -@@ -3431,7 +3674,7 @@ int tcp_abort(struct sock *sk, int err) +@@ -3432,7 +3675,7 @@ /* Don't race with BH socket closes such as inet_csk_listen_stop. */ local_bh_disable(); @@ -3561,7 +3505,7 @@ index fe11128..f5c905d 100644 if (!sock_flag(sk, SOCK_DEAD)) { sk->sk_err = err; -@@ -3443,9 +3686,9 @@ int tcp_abort(struct sock *sk, int err) +@@ -3444,10 +3687,10 @@ tcp_done(sk); } @@ -3574,10 +3518,9 @@ index fe11128..f5c905d 100644 return 0; } EXPORT_SYMBOL_GPL(tcp_abort); -diff --git a/linux-4.14.24/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c -index fbbeda6..7a3c8ce 100644 ---- a/linux-4.14.24/net/ipv4/tcp_fastopen.c -+++ b/net/ipv4/tcp_fastopen.c +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-16 20:53:41.000000000 +0200 @@ -9,6 +9,7 @@ #include #include @@ -3586,7 +3529,7 @@ index fbbeda6..7a3c8ce 100644 int sysctl_tcp_fastopen __read_mostly = TFO_CLIENT_ENABLE; -@@ -176,7 +177,7 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk, +@@ -176,7 +177,7 @@ { struct tcp_sock *tp; struct request_sock_queue *queue = &inet_csk(sk)->icsk_accept_queue; @@ -3595,7 +3538,7 @@ index fbbeda6..7a3c8ce 100644 bool own_req; req->num_retrans = 0; -@@ -216,20 +217,27 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk, +@@ -216,20 +217,27 @@ refcount_set(&req->rsk_refcnt, 2); @@ -3630,10 +3573,9 @@ index fbbeda6..7a3c8ce 100644 /* tcp_conn_request() is sending the SYNACK, * and queues the child into listener accept queue. */ -diff --git a/linux-4.14.24/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index d9d215e..c4ec134 100644 ---- a/linux-4.14.24/net/ipv4/tcp_input.c -+++ b/net/ipv4/tcp_input.c +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-16 20:53:41.000000000 +0200 @@ -76,6 +76,9 @@ #include #include @@ -3644,7 +3586,7 @@ index d9d215e..c4ec134 100644 int sysctl_tcp_fack __read_mostly; int sysctl_tcp_max_reordering __read_mostly = 300; -@@ -96,28 +99,6 @@ int sysctl_tcp_moderate_rcvbuf __read_mostly = 1; +@@ -96,28 +99,6 @@ int sysctl_tcp_early_retrans __read_mostly = 3; int sysctl_tcp_invalid_ratelimit __read_mostly = HZ/2; @@ -3673,7 +3615,7 @@ index d9d215e..c4ec134 100644 #define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH) #define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH)) -@@ -209,7 +190,7 @@ static void tcp_incr_quickack(struct sock *sk) +@@ -209,7 +190,7 @@ icsk->icsk_ack.quick = min(quickacks, TCP_MAX_QUICKACKS); } @@ -3682,7 +3624,7 @@ index d9d215e..c4ec134 100644 { struct inet_connection_sock *icsk = inet_csk(sk); tcp_incr_quickack(sk); -@@ -324,8 +305,12 @@ static void tcp_sndbuf_expand(struct sock *sk) +@@ -324,8 +305,12 @@ per_mss = roundup_pow_of_two(per_mss) + SKB_DATA_ALIGN(sizeof(struct sk_buff)); @@ -3697,7 +3639,7 @@ index d9d215e..c4ec134 100644 /* Fast Recovery (RFC 5681 3.2) : * Cubic needs 1.7 factor, rounded to 2 to include -@@ -334,8 +319,16 @@ static void tcp_sndbuf_expand(struct sock *sk) +@@ -334,8 +319,16 @@ sndmem = ca_ops->sndbuf_expand ? ca_ops->sndbuf_expand(sk) : 2; sndmem *= nr_segs * per_mss; @@ -3715,7 +3657,7 @@ index d9d215e..c4ec134 100644 } /* 2. Tuning advertised window (window_clamp, rcv_ssthresh) -@@ -384,10 +377,15 @@ static int __tcp_grow_window(const struct sock *sk, const struct sk_buff *skb) +@@ -384,10 +377,15 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) { struct tcp_sock *tp = tcp_sk(sk); @@ -3733,7 +3675,7 @@ index d9d215e..c4ec134 100644 !tcp_under_memory_pressure(sk)) { int incr; -@@ -395,14 +393,14 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) +@@ -395,14 +393,14 @@ * will fit to rcvbuf in future. */ if (tcp_win_from_space(skb->truesize) <= skb->len) @@ -3752,7 +3694,7 @@ index d9d215e..c4ec134 100644 inet_csk(sk)->icsk_ack.quick |= 1; } } -@@ -596,7 +594,10 @@ void tcp_rcv_space_adjust(struct sock *sk) +@@ -596,7 +594,10 @@ tcp_mstamp_refresh(tp); time = tcp_stamp_us_delta(tp->tcp_mstamp, tp->rcvq_space.time); @@ -3764,7 +3706,7 @@ index d9d215e..c4ec134 100644 return; /* Number of bytes copied to user in last RTT */ -@@ -830,7 +831,7 @@ static void tcp_update_pacing_rate(struct sock *sk) +@@ -830,7 +831,7 @@ /* Calculate rto without backoff. This is the second half of Van Jacobson's * routine referred to above. */ @@ -3773,7 +3715,7 @@ index d9d215e..c4ec134 100644 { const struct tcp_sock *tp = tcp_sk(sk); /* Old crap is replaced with new one. 8) -@@ -1404,7 +1405,11 @@ static struct sk_buff *tcp_shift_skb_data(struct sock *sk, struct sk_buff *skb, +@@ -1404,7 +1405,11 @@ int len; int in_sack; @@ -3786,7 +3728,7 @@ index d9d215e..c4ec134 100644 goto fallback; /* Normally R but no L won't result in plain S */ -@@ -2965,7 +2970,7 @@ static bool tcp_ack_update_rtt(struct sock *sk, const int flag, +@@ -2956,7 +2961,7 @@ */ tcp_update_rtt_min(sk, ca_rtt_us); tcp_rtt_estimator(sk, seq_rtt_us); @@ -3795,7 +3737,7 @@ index d9d215e..c4ec134 100644 /* RFC6298: only reset backoff on valid RTT measurement. */ inet_csk(sk)->icsk_backoff = 0; -@@ -3033,7 +3038,7 @@ static void tcp_set_xmit_timer(struct sock *sk) +@@ -3024,7 +3029,7 @@ } /* If we get here, the whole TSO packet has not been acked. */ @@ -3804,7 +3746,7 @@ index d9d215e..c4ec134 100644 { struct tcp_sock *tp = tcp_sk(sk); u32 packets_acked; -@@ -3156,6 +3161,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets, +@@ -3147,6 +3152,8 @@ */ if (likely(!(scb->tcp_flags & TCPHDR_SYN))) { flag |= FLAG_DATA_ACKED; @@ -3813,7 +3755,7 @@ index d9d215e..c4ec134 100644 } else { flag |= FLAG_SYN_ACKED; tp->retrans_stamp = 0; -@@ -3259,7 +3266,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets, +@@ -3250,7 +3257,7 @@ return flag; } @@ -3822,7 +3764,7 @@ index d9d215e..c4ec134 100644 { const struct tcp_sock *tp = tcp_sk(sk); struct inet_connection_sock *icsk = inet_csk(sk); -@@ -3329,9 +3336,8 @@ static void tcp_cong_control(struct sock *sk, u32 ack, u32 acked_sacked, +@@ -3320,9 +3327,8 @@ /* Check that window update is acceptable. * The function assumes that snd_una<=ack<=snd_next. */ @@ -3834,7 +3776,7 @@ index d9d215e..c4ec134 100644 { return after(ack, tp->snd_una) || after(ack_seq, tp->snd_wl1) || -@@ -3551,7 +3557,7 @@ static void tcp_xmit_recovery(struct sock *sk, int rexmit) +@@ -3542,7 +3548,7 @@ } /* This routine deals with incoming acks, but not outgoing ones. */ @@ -3843,7 +3785,7 @@ index d9d215e..c4ec134 100644 { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); -@@ -3658,6 +3664,16 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) +@@ -3649,6 +3655,16 @@ flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una, &acked, &sack_state); @@ -3860,7 +3802,7 @@ index d9d215e..c4ec134 100644 if (tp->tlp_high_seq) tcp_process_tlp_ack(sk, ack, flag); /* If needed, reset TLP/RTO timer; RACK may later override this. */ -@@ -3736,8 +3752,10 @@ static void tcp_parse_fastopen_option(int len, const unsigned char *cookie, +@@ -3727,8 +3743,10 @@ */ void tcp_parse_options(const struct net *net, const struct sk_buff *skb, @@ -3873,7 +3815,7 @@ index d9d215e..c4ec134 100644 { const unsigned char *ptr; const struct tcphdr *th = tcp_hdr(skb); -@@ -3821,6 +3839,10 @@ void tcp_parse_options(const struct net *net, +@@ -3812,6 +3830,10 @@ */ break; #endif @@ -3884,7 +3826,7 @@ index d9d215e..c4ec134 100644 case TCPOPT_FASTOPEN: tcp_parse_fastopen_option( opsize - TCPOLEN_FASTOPEN_BASE, -@@ -3885,7 +3907,9 @@ static bool tcp_fast_parse_options(const struct net *net, +@@ -3876,7 +3898,9 @@ return true; } @@ -3895,7 +3837,7 @@ index d9d215e..c4ec134 100644 if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) tp->rx_opt.rcv_tsecr -= tp->tsoffset; -@@ -4044,6 +4068,11 @@ void tcp_fin(struct sock *sk) +@@ -4033,6 +4057,11 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -3907,7 +3849,7 @@ index d9d215e..c4ec134 100644 inet_csk_schedule_ack(sk); sk->sk_shutdown |= RCV_SHUTDOWN; -@@ -4054,6 +4083,10 @@ void tcp_fin(struct sock *sk) +@@ -4043,6 +4072,10 @@ case TCP_ESTABLISHED: /* Move to CLOSE_WAIT */ tcp_set_state(sk, TCP_CLOSE_WAIT); @@ -3918,7 +3860,7 @@ index d9d215e..c4ec134 100644 inet_csk(sk)->icsk_ack.pingpong = 1; break; -@@ -4076,9 +4109,16 @@ void tcp_fin(struct sock *sk) +@@ -4065,9 +4098,16 @@ tcp_set_state(sk, TCP_CLOSING); break; case TCP_FIN_WAIT2: @@ -3936,7 +3878,7 @@ index d9d215e..c4ec134 100644 break; default: /* Only TCP_LISTEN and TCP_CLOSE are left, in these -@@ -4100,6 +4140,10 @@ void tcp_fin(struct sock *sk) +@@ -4089,6 +4129,10 @@ if (!sock_flag(sk, SOCK_DEAD)) { sk->sk_state_change(sk); @@ -3947,7 +3889,7 @@ index d9d215e..c4ec134 100644 /* Do not send POLL_HUP for half duplex close. */ if (sk->sk_shutdown == SHUTDOWN_MASK || sk->sk_state == TCP_CLOSE) -@@ -4306,6 +4350,9 @@ static bool tcp_try_coalesce(struct sock *sk, +@@ -4295,6 +4339,9 @@ *fragstolen = false; @@ -3957,7 +3899,7 @@ index d9d215e..c4ec134 100644 /* Its possible this segment overlaps with prior segment in queue */ if (TCP_SKB_CB(from)->seq != TCP_SKB_CB(to)->end_seq) return false; -@@ -4340,7 +4387,7 @@ static void tcp_drop(struct sock *sk, struct sk_buff *skb) +@@ -4329,7 +4376,7 @@ /* This one checks to see if we can put data from the * out_of_order queue into the receive_queue. */ @@ -3966,7 +3908,7 @@ index d9d215e..c4ec134 100644 { struct tcp_sock *tp = tcp_sk(sk); __u32 dsack_high = tp->rcv_nxt; -@@ -4366,7 +4413,14 @@ static void tcp_ofo_queue(struct sock *sk) +@@ -4355,7 +4402,14 @@ if (TCP_SKB_CB(skb)->has_rxtstamp) skb->tstamp = TCP_SKB_CB(skb)->swtstamp; @@ -3982,7 +3924,7 @@ index d9d215e..c4ec134 100644 SOCK_DEBUG(sk, "ofo packet was already received\n"); tcp_drop(sk, skb); continue; -@@ -4401,6 +4455,9 @@ static int tcp_prune_queue(struct sock *sk); +@@ -4390,6 +4444,9 @@ static int tcp_try_rmem_schedule(struct sock *sk, struct sk_buff *skb, unsigned int size) { @@ -3992,7 +3934,7 @@ index d9d215e..c4ec134 100644 if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || !sk_rmem_schedule(sk, skb, size)) { -@@ -4415,7 +4472,7 @@ static int tcp_try_rmem_schedule(struct sock *sk, struct sk_buff *skb, +@@ -4404,7 +4461,7 @@ return 0; } @@ -4001,7 +3943,7 @@ index d9d215e..c4ec134 100644 { struct tcp_sock *tp = tcp_sk(sk); struct rb_node **p, *q, *parent; -@@ -4487,7 +4544,8 @@ coalesce_done: +@@ -4476,7 +4533,8 @@ continue; } if (before(seq, TCP_SKB_CB(skb1)->end_seq)) { @@ -4011,7 +3953,7 @@ index d9d215e..c4ec134 100644 /* All the bits are present. Drop. */ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOMERGE); -@@ -4536,6 +4594,11 @@ merge_right: +@@ -4525,6 +4583,11 @@ end_seq); break; } @@ -4023,7 +3965,7 @@ index d9d215e..c4ec134 100644 rb_erase(&skb1->rbnode, &tp->out_of_order_queue); tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq, TCP_SKB_CB(skb1)->end_seq); -@@ -4547,7 +4610,7 @@ merge_right: +@@ -4536,7 +4599,7 @@ tp->ooo_last_skb = skb; add_sack: @@ -4032,7 +3974,7 @@ index d9d215e..c4ec134 100644 tcp_sack_new_ofo_skb(sk, seq, end_seq); end: if (skb) { -@@ -4557,8 +4620,8 @@ end: +@@ -4546,8 +4609,8 @@ } } @@ -4043,7 +3985,7 @@ index d9d215e..c4ec134 100644 { int eaten; struct sk_buff *tail = skb_peek_tail(&sk->sk_receive_queue); -@@ -4631,10 +4694,14 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) +@@ -4620,10 +4683,14 @@ bool fragstolen; int eaten; @@ -4059,7 +4001,7 @@ index d9d215e..c4ec134 100644 skb_dst_drop(skb); __skb_pull(skb, tcp_hdr(skb)->doff * 4); -@@ -4659,7 +4726,7 @@ queue_and_out: +@@ -4648,7 +4715,7 @@ eaten = tcp_queue_rcv(sk, skb, 0, &fragstolen); tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq); @@ -4068,7 +4010,7 @@ index d9d215e..c4ec134 100644 tcp_event_data_recv(sk, skb); if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) tcp_fin(sk); -@@ -4681,7 +4748,11 @@ queue_and_out: +@@ -4670,7 +4737,11 @@ if (eaten > 0) kfree_skb_partial(skb, fragstolen); @@ -4081,7 +4023,7 @@ index d9d215e..c4ec134 100644 sk->sk_data_ready(sk); return; } -@@ -5008,7 +5079,7 @@ static int tcp_prune_queue(struct sock *sk) +@@ -4997,7 +5068,7 @@ return -1; } @@ -4090,7 +4032,7 @@ index d9d215e..c4ec134 100644 { const struct tcp_sock *tp = tcp_sk(sk); -@@ -5043,7 +5114,7 @@ static void tcp_new_space(struct sock *sk) +@@ -5032,7 +5103,7 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -4099,7 +4041,7 @@ index d9d215e..c4ec134 100644 tcp_sndbuf_expand(sk); tp->snd_cwnd_stamp = tcp_jiffies32; } -@@ -5057,10 +5128,11 @@ static void tcp_check_space(struct sock *sk) +@@ -5046,10 +5117,11 @@ sock_reset_flag(sk, SOCK_QUEUE_SHRUNK); /* pairs with tcp_poll() */ smp_mb(); @@ -4114,7 +4056,7 @@ index d9d215e..c4ec134 100644 tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED); } } -@@ -5084,7 +5156,7 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible) +@@ -5073,7 +5145,7 @@ /* ... and right edge of window advances far enough. * (tcp_recvmsg() will send ACK otherwise). Or... */ @@ -4123,7 +4065,7 @@ index d9d215e..c4ec134 100644 /* We ACK each frame or... */ tcp_in_quickack_mode(sk) || /* We have out of order data. */ -@@ -5186,6 +5258,10 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *t +@@ -5175,6 +5247,10 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -4134,7 +4076,7 @@ index d9d215e..c4ec134 100644 /* Check if we get a new urgent pointer - normally not. */ if (th->urg) tcp_check_urg(sk, th); -@@ -5328,9 +5404,15 @@ syn_challenge: +@@ -5317,9 +5393,15 @@ goto discard; } @@ -4150,7 +4092,7 @@ index d9d215e..c4ec134 100644 tcp_drop(sk, skb); return false; } -@@ -5384,6 +5466,10 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, +@@ -5373,6 +5455,10 @@ tp->rx_opt.saw_tstamp = 0; @@ -4161,7 +4103,7 @@ index d9d215e..c4ec134 100644 /* pred_flags is 0xS?10 << 16 + snd_wnd * if header_prediction is to be made * 'S' will always be tp->tcp_header_len >> 2 -@@ -5553,7 +5639,7 @@ void tcp_finish_connect(struct sock *sk, struct sk_buff *skb) +@@ -5542,7 +5628,7 @@ */ tp->lsndtime = tcp_jiffies32; @@ -4170,7 +4112,7 @@ index d9d215e..c4ec134 100644 if (sock_flag(sk, SOCK_KEEPOPEN)) inet_csk_reset_keepalive_timer(sk, keepalive_time_when(tp)); -@@ -5568,7 +5654,8 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, +@@ -5557,7 +5643,8 @@ struct tcp_fastopen_cookie *cookie) { struct tcp_sock *tp = tcp_sk(sk); @@ -4180,7 +4122,7 @@ index d9d215e..c4ec134 100644 u16 mss = tp->rx_opt.mss_clamp, try_exp = 0; bool syn_drop = false; -@@ -5578,7 +5665,7 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, +@@ -5567,7 +5654,7 @@ /* Get original SYNACK MSS value if user MSS sets mss_clamp */ tcp_clear_options(&opt); opt.user_mss = opt.mss_clamp = 0; @@ -4189,7 +4131,7 @@ index d9d215e..c4ec134 100644 mss = opt.mss_clamp; } -@@ -5602,7 +5689,11 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, +@@ -5591,7 +5678,11 @@ tcp_fastopen_cache_set(sk, mss, cookie, syn_drop, try_exp); @@ -4202,7 +4144,7 @@ index d9d215e..c4ec134 100644 tcp_for_write_queue_from(data, sk) { if (data == tcp_send_head(sk) || __tcp_retransmit_skb(sk, data, 1)) -@@ -5630,9 +5721,13 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -5619,9 +5710,13 @@ struct tcp_sock *tp = tcp_sk(sk); struct tcp_fastopen_cookie foc = { .len = -1 }; int saved_clamp = tp->rx_opt.mss_clamp; @@ -4217,7 +4159,7 @@ index d9d215e..c4ec134 100644 if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) tp->rx_opt.rcv_tsecr -= tp->tsoffset; -@@ -5692,6 +5787,30 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -5681,6 +5776,30 @@ tcp_init_wl(tp, TCP_SKB_CB(skb)->seq); tcp_ack(sk, skb, FLAG_SLOWPATH); @@ -4248,7 +4190,7 @@ index d9d215e..c4ec134 100644 /* Ok.. it's good. Set up sequence numbers and * move to established. */ -@@ -5718,6 +5837,11 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -5707,6 +5826,11 @@ tp->tcp_header_len = sizeof(struct tcphdr); } @@ -4260,7 +4202,7 @@ index d9d215e..c4ec134 100644 if (tcp_is_sack(tp) && sysctl_tcp_fack) tcp_enable_fack(tp); -@@ -5743,9 +5867,12 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, +@@ -5732,9 +5856,12 @@ } if (fastopen_fail) return -1; @@ -4275,7 +4217,7 @@ index d9d215e..c4ec134 100644 /* Save one ACK. Data will be ready after * several ticks, if write_pending is set. * -@@ -5784,6 +5911,7 @@ discard: +@@ -5773,6 +5900,7 @@ tcp_paws_reject(&tp->rx_opt, 0)) goto discard_and_undo; @@ -4283,7 +4225,7 @@ index d9d215e..c4ec134 100644 if (th->syn) { /* We see SYN without ACK. It is attempt of * simultaneous connect with crossed SYNs. -@@ -5800,6 +5928,11 @@ discard: +@@ -5789,6 +5917,11 @@ tp->tcp_header_len = sizeof(struct tcphdr); } @@ -4295,7 +4237,7 @@ index d9d215e..c4ec134 100644 tp->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; tp->copied_seq = tp->rcv_nxt; tp->rcv_wup = TCP_SKB_CB(skb)->seq + 1; -@@ -5858,6 +5991,7 @@ reset_and_undo: +@@ -5847,6 +5980,7 @@ */ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) @@ -4303,7 +4245,7 @@ index d9d215e..c4ec134 100644 { struct tcp_sock *tp = tcp_sk(sk); struct inet_connection_sock *icsk = inet_csk(sk); -@@ -5898,6 +6032,16 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -5887,6 +6021,16 @@ tp->rx_opt.saw_tstamp = 0; tcp_mstamp_refresh(tp); queued = tcp_rcv_synsent_state_process(sk, skb, th); @@ -4320,7 +4262,7 @@ index d9d215e..c4ec134 100644 if (queued >= 0) return queued; -@@ -5905,6 +6049,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -5894,6 +6038,8 @@ tcp_urg(sk, skb, th); __kfree_skb(skb); tcp_data_snd_check(sk); @@ -4329,7 +4271,7 @@ index d9d215e..c4ec134 100644 return 0; } -@@ -5955,7 +6101,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -5944,7 +6090,7 @@ tcp_mtup_init(sk); tp->copied_seq = tp->rcv_nxt; @@ -4338,7 +4280,7 @@ index d9d215e..c4ec134 100644 } smp_mb(); tcp_set_state(sk, TCP_ESTABLISHED); -@@ -5974,6 +6120,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -5963,6 +6109,8 @@ if (tp->rx_opt.tstamp_ok) tp->advmss -= TCPOLEN_TSTAMP_ALIGNED; @@ -4347,7 +4289,7 @@ index d9d215e..c4ec134 100644 if (req) { /* Re-arm the timer because data may have been sent out. -@@ -5996,6 +6144,16 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -5985,6 +6133,16 @@ tcp_initialize_rcv_mss(sk); tcp_fast_path_on(tp); @@ -4364,7 +4306,7 @@ index d9d215e..c4ec134 100644 break; case TCP_FIN_WAIT1: { -@@ -6043,7 +6201,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6032,7 +6190,8 @@ tmo = tcp_fin_time(sk); if (tmo > TCP_TIMEWAIT_LEN) { inet_csk_reset_keepalive_timer(sk, tmo - TCP_TIMEWAIT_LEN); @@ -4374,7 +4316,7 @@ index d9d215e..c4ec134 100644 /* Bad case. We could lose such FIN otherwise. * It is not a big problem, but it looks confusing * and not so rare event. We still can lose it now, -@@ -6052,7 +6211,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6041,7 +6200,7 @@ */ inet_csk_reset_keepalive_timer(sk, tmo); } else { @@ -4383,7 +4325,7 @@ index d9d215e..c4ec134 100644 goto discard; } break; -@@ -6060,7 +6219,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6049,7 +6208,7 @@ case TCP_CLOSING: if (tp->snd_una == tp->write_seq) { @@ -4392,7 +4334,7 @@ index d9d215e..c4ec134 100644 goto discard; } break; -@@ -6072,6 +6231,9 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6061,6 +6220,9 @@ goto discard; } break; @@ -4402,7 +4344,7 @@ index d9d215e..c4ec134 100644 } /* step 6: check the URG bit */ -@@ -6092,7 +6254,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) +@@ -6081,7 +6243,8 @@ */ if (sk->sk_shutdown & RCV_SHUTDOWN) { if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && @@ -4412,7 +4354,7 @@ index d9d215e..c4ec134 100644 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONDATA); tcp_reset(sk); return 1; -@@ -6189,6 +6352,8 @@ static void tcp_openreq_init(struct request_sock *req, +@@ -6178,6 +6341,8 @@ ireq->wscale_ok = rx_opt->wscale_ok; ireq->acked = 0; ireq->ecn_ok = 0; @@ -4421,7 +4363,7 @@ index d9d215e..c4ec134 100644 ireq->ir_rmt_port = tcp_hdr(skb)->source; ireq->ir_num = ntohs(tcp_hdr(skb)->dest); ireq->ir_mark = inet_request_mark(sk, skb); -@@ -6283,12 +6448,17 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6272,12 +6437,17 @@ /* TW buckets are converted to open requests without * limitations, they conserve resources and peer is * evidently real one. @@ -4440,7 +4382,7 @@ index d9d215e..c4ec134 100644 } if (sk_acceptq_is_full(sk)) { -@@ -6306,8 +6476,8 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6295,8 +6465,8 @@ tcp_clear_options(&tmp_opt); tmp_opt.mss_clamp = af_ops->mss_clamp; tmp_opt.user_mss = tp->rx_opt.user_mss; @@ -4451,7 +4393,7 @@ index d9d215e..c4ec134 100644 if (want_cookie && !tmp_opt.saw_tstamp) tcp_clear_options(&tmp_opt); -@@ -6319,7 +6489,8 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6308,7 +6478,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); @@ -4461,7 +4403,7 @@ index d9d215e..c4ec134 100644 if (security_inet_conn_request(sk, skb, req)) goto drop_and_free; -@@ -6355,7 +6526,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6344,7 +6515,7 @@ tcp_ecn_create_request(req, skb, sk, dst); if (want_cookie) { @@ -4470,7 +4412,7 @@ index d9d215e..c4ec134 100644 req->cookie_ts = tmp_opt.tstamp_ok; if (!tmp_opt.tstamp_ok) inet_rsk(req)->ecn_ok = 0; -@@ -6369,12 +6540,18 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, +@@ -6358,12 +6529,18 @@ fastopen_sk = tcp_try_fastopen(sk, skb, req, &foc); } if (fastopen_sk) { @@ -4490,10 +4432,9 @@ index d9d215e..c4ec134 100644 sock_put(fastopen_sk); } else { tcp_rsk(req)->tfo_listener = false; -diff --git a/linux-4.14.24/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c -index cab4b93..830849e 100644 ---- a/linux-4.14.24/net/ipv4/tcp_ipv4.c -+++ b/net/ipv4/tcp_ipv4.c +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-16 20:53:41.000000000 +0200 @@ -67,6 +67,8 @@ #include #include @@ -4503,7 +4444,7 @@ index cab4b93..830849e 100644 #include #include #include -@@ -372,7 +374,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -372,7 +374,7 @@ struct inet_sock *inet; const int type = icmp_hdr(icmp_skb)->type; const int code = icmp_hdr(icmp_skb)->code; @@ -4512,7 +4453,7 @@ index cab4b93..830849e 100644 struct sk_buff *skb; struct request_sock *fastopen; u32 seq, snd_una; -@@ -401,13 +403,19 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -401,13 +403,19 @@ (code == ICMP_NET_UNREACH || code == ICMP_HOST_UNREACH))); @@ -4534,7 +4475,7 @@ index cab4b93..830849e 100644 if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)) __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS); } -@@ -420,7 +428,6 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -420,7 +428,6 @@ } icsk = inet_csk(sk); @@ -4542,7 +4483,7 @@ index cab4b93..830849e 100644 /* XXX (TFO) - tp->snd_una should be ISN (tcp_create_openreq_child() */ fastopen = tp->fastopen_rsk; snd_una = fastopen ? tcp_rsk(fastopen)->snt_isn : tp->snd_una; -@@ -454,11 +461,13 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -454,11 +461,13 @@ goto out; tp->mtu_info = info; @@ -4557,7 +4498,7 @@ index cab4b93..830849e 100644 } goto out; } -@@ -472,7 +481,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -472,7 +481,7 @@ !icsk->icsk_backoff || fastopen) break; @@ -4566,7 +4507,7 @@ index cab4b93..830849e 100644 break; icsk->icsk_backoff--; -@@ -494,7 +503,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -494,7 +503,7 @@ } else { /* RTO revert clocked out retransmission. * Will retransmit now */ @@ -4575,7 +4516,7 @@ index cab4b93..830849e 100644 } break; -@@ -514,7 +523,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -514,7 +523,7 @@ if (fastopen && !fastopen->sk) break; @@ -4584,7 +4525,7 @@ index cab4b93..830849e 100644 sk->sk_err = err; sk->sk_error_report(sk); -@@ -543,7 +552,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -543,7 +552,7 @@ */ inet = inet_sk(sk); @@ -4593,7 +4534,7 @@ index cab4b93..830849e 100644 sk->sk_err = err; sk->sk_error_report(sk); } else { /* Only an error on timeout */ -@@ -551,7 +560,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) +@@ -551,7 +560,7 @@ } out: @@ -4602,7 +4543,7 @@ index cab4b93..830849e 100644 sock_put(sk); } -@@ -593,7 +602,7 @@ EXPORT_SYMBOL(tcp_v4_send_check); +@@ -593,7 +602,7 @@ * Exception: precedence violation. We do not implement it in any case. */ @@ -4611,7 +4552,7 @@ index cab4b93..830849e 100644 { const struct tcphdr *th = tcp_hdr(skb); struct { -@@ -730,10 +739,10 @@ out: +@@ -730,10 +739,10 @@ */ static void tcp_v4_send_ack(const struct sock *sk, @@ -4624,18 +4565,18 @@ index cab4b93..830849e 100644 { const struct tcphdr *th = tcp_hdr(skb); struct { -@@ -741,6 +750,10 @@ static void tcp_v4_send_ack(const struct sock *sk, - __be32 opt[(TCPOLEN_TSTAMP_ALIGNED >> 2) +@@ -742,6 +751,10 @@ #ifdef CONFIG_TCP_MD5SIG + (TCPOLEN_MD5SIG_ALIGNED >> 2) -+#endif + #endif +#ifdef CONFIG_MPTCP + + ((MPTCP_SUB_LEN_DSS >> 2) + + (MPTCP_SUB_LEN_ACK >> 2)) - #endif ++#endif ]; } rep; -@@ -786,6 +799,21 @@ static void tcp_v4_send_ack(const struct sock *sk, + struct net *net = sock_net(sk); +@@ -786,6 +799,21 @@ ip_hdr(skb)->daddr, &rep.th); } #endif @@ -4657,7 +4598,7 @@ index cab4b93..830849e 100644 arg.flags = reply_flags; arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr, ip_hdr(skb)->saddr, /* XXX */ -@@ -809,28 +837,36 @@ static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) +@@ -809,28 +837,36 @@ { struct inet_timewait_sock *tw = inet_twsk(sk); struct tcp_timewait_sock *tcptw = tcp_twsk(sk); @@ -4699,7 +4640,7 @@ index cab4b93..830849e 100644 tcp_sk(sk)->snd_nxt; /* RFC 7323 2.3 -@@ -839,7 +875,7 @@ static void tcp_v4_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, +@@ -839,7 +875,7 @@ * Rcv.Wind.Shift bits: */ tcp_v4_send_ack(sk, skb, seq, @@ -4708,7 +4649,7 @@ index cab4b93..830849e 100644 req->rsk_rcv_wnd >> inet_rsk(req)->rcv_wscale, tcp_time_stamp_raw() + tcp_rsk(req)->ts_off, req->ts_recent, -@@ -847,7 +883,7 @@ static void tcp_v4_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, +@@ -847,7 +883,7 @@ tcp_md5_do_lookup(sk, (union tcp_md5_addr *)&ip_hdr(skb)->saddr, AF_INET), inet_rsk(req)->no_srccheck ? IP_REPLY_ARG_NOSRCCHECK : 0, @@ -4717,7 +4658,7 @@ index cab4b93..830849e 100644 } /* -@@ -855,11 +891,11 @@ static void tcp_v4_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, +@@ -855,11 +891,11 @@ * This still operates on a request_sock only, not on a big * socket. */ @@ -4734,7 +4675,7 @@ index cab4b93..830849e 100644 { const struct inet_request_sock *ireq = inet_rsk(req); struct flowi4 fl4; -@@ -887,7 +923,7 @@ static int tcp_v4_send_synack(const struct sock *sk, struct dst_entry *dst, +@@ -887,7 +923,7 @@ /* * IPv4 request_sock destructor. */ @@ -4743,7 +4684,7 @@ index cab4b93..830849e 100644 { kfree(rcu_dereference_protected(inet_rsk(req)->ireq_opt, 1)); } -@@ -1260,9 +1296,10 @@ static bool tcp_v4_inbound_md5_hash(const struct sock *sk, +@@ -1260,9 +1296,10 @@ return false; } @@ -4757,7 +4698,7 @@ index cab4b93..830849e 100644 { struct inet_request_sock *ireq = inet_rsk(req); struct net *net = sock_net(sk_listener); -@@ -1270,6 +1307,8 @@ static void tcp_v4_init_req(struct request_sock *req, +@@ -1270,6 +1307,8 @@ sk_rcv_saddr_set(req_to_sk(req), ip_hdr(skb)->daddr); sk_daddr_set(req_to_sk(req), ip_hdr(skb)->saddr); RCU_INIT_POINTER(ireq->ireq_opt, tcp_v4_save_options(net, skb)); @@ -4766,7 +4707,7 @@ index cab4b93..830849e 100644 } static struct dst_entry *tcp_v4_route_req(const struct sock *sk, -@@ -1289,7 +1328,7 @@ struct request_sock_ops tcp_request_sock_ops __read_mostly = { +@@ -1289,7 +1328,7 @@ .syn_ack_timeout = tcp_syn_ack_timeout, }; @@ -4775,7 +4716,7 @@ index cab4b93..830849e 100644 .mss_clamp = TCP_MSS_DEFAULT, #ifdef CONFIG_TCP_MD5SIG .req_md5_lookup = tcp_v4_md5_lookup, -@@ -1426,7 +1465,7 @@ put_and_exit: +@@ -1426,7 +1465,7 @@ } EXPORT_SYMBOL(tcp_v4_syn_recv_sock); @@ -4784,7 +4725,7 @@ index cab4b93..830849e 100644 { #ifdef CONFIG_SYN_COOKIES const struct tcphdr *th = tcp_hdr(skb); -@@ -1449,6 +1488,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) +@@ -1449,6 +1488,9 @@ { struct sock *rsk; @@ -4794,7 +4735,7 @@ index cab4b93..830849e 100644 if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ struct dst_entry *dst = sk->sk_rx_dst; -@@ -1607,6 +1649,10 @@ static void tcp_v4_fill_cb(struct sk_buff *skb, const struct iphdr *iph, +@@ -1607,6 +1649,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); @@ -4805,7 +4746,7 @@ index cab4b93..830849e 100644 TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th); TCP_SKB_CB(skb)->tcp_tw_isn = 0; TCP_SKB_CB(skb)->ip_dsfield = ipv4_get_dsfield(iph); -@@ -1625,8 +1671,8 @@ int tcp_v4_rcv(struct sk_buff *skb) +@@ -1625,8 +1671,8 @@ int sdif = inet_sdif(skb); const struct iphdr *iph; const struct tcphdr *th; @@ -4815,7 +4756,7 @@ index cab4b93..830849e 100644 int ret; if (skb->pkt_type != PACKET_HOST) -@@ -1675,7 +1721,7 @@ process: +@@ -1675,7 +1721,7 @@ reqsk_put(req); goto discard_it; } @@ -4824,7 +4765,7 @@ index cab4b93..830849e 100644 inet_csk_reqsk_queue_drop_and_put(sk, req); goto lookup; } -@@ -1684,6 +1730,36 @@ process: +@@ -1684,6 +1730,36 @@ */ sock_hold(sk); refcounted = true; @@ -4861,7 +4802,7 @@ index cab4b93..830849e 100644 nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; -@@ -1693,11 +1769,15 @@ process: +@@ -1693,11 +1769,15 @@ } if (!nsk) { reqsk_put(req); @@ -4877,7 +4818,7 @@ index cab4b93..830849e 100644 } else if (tcp_child_process(sk, nsk, skb)) { tcp_v4_send_reset(nsk, skb); goto discard_and_relse; -@@ -1734,15 +1814,24 @@ process: +@@ -1734,15 +1814,24 @@ sk_incoming_cpu_update(sk); @@ -4906,7 +4847,7 @@ index cab4b93..830849e 100644 put_and_return: if (refcounted) -@@ -1756,6 +1845,19 @@ no_tcp_socket: +@@ -1756,6 +1845,19 @@ tcp_v4_fill_cb(skb, iph, th); @@ -4926,7 +4867,7 @@ index cab4b93..830849e 100644 if (tcp_checksum_complete(skb)) { csum_error: __TCP_INC_STATS(net, TCP_MIB_CSUMERRORS); -@@ -1804,6 +1906,18 @@ do_time_wait: +@@ -1804,6 +1906,18 @@ refcounted = false; goto process; } @@ -4945,7 +4886,7 @@ index cab4b93..830849e 100644 /* Fall through to ACK */ } case TCP_TW_ACK: -@@ -1872,7 +1986,12 @@ static int tcp_v4_init_sock(struct sock *sk) +@@ -1872,7 +1986,12 @@ tcp_init_sock(sk); @@ -4959,7 +4900,7 @@ index cab4b93..830849e 100644 #ifdef CONFIG_TCP_MD5SIG tcp_sk(sk)->af_specific = &tcp_sock_ipv4_specific; -@@ -1889,6 +2008,11 @@ void tcp_v4_destroy_sock(struct sock *sk) +@@ -1889,6 +2008,11 @@ tcp_cleanup_congestion_control(sk); @@ -4971,16 +4912,15 @@ index cab4b93..830849e 100644 tcp_cleanup_ulp(sk); /* Cleanup up the write buffer. */ -@@ -2434,8 +2558,16 @@ struct proto tcp_prot = { - #ifdef CONFIG_COMPAT +@@ -2435,7 +2559,15 @@ .compat_setsockopt = compat_tcp_setsockopt, .compat_getsockopt = compat_tcp_getsockopt, -+#endif + #endif +#ifdef CONFIG_MEMCG_KMEM + .init_cgroup = tcp_init_cgroup, + .destroy_cgroup = tcp_destroy_cgroup, + .proto_cgroup = tcp_proto_cgroup, - #endif ++#endif .diag_destroy = tcp_abort, +#ifdef CONFIG_MPTCP + .clear_sk = mptcp_clear_sk, @@ -4988,10 +4928,9 @@ index cab4b93..830849e 100644 }; EXPORT_SYMBOL(tcp_prot); -diff --git a/linux-4.14.24/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c -index 420fecb..c8a295b 100644 ---- a/linux-4.14.24/net/ipv4/tcp_minisocks.c -+++ b/net/ipv4/tcp_minisocks.c +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-16 20:53:41.000000000 +0200 @@ -18,11 +18,13 @@ * Jorge Cwik, */ @@ -5006,7 +4945,7 @@ index 420fecb..c8a295b 100644 #include #include #include -@@ -95,10 +97,14 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, +@@ -95,10 +97,14 @@ struct tcp_options_received tmp_opt; struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); bool paws_reject = false; @@ -5023,7 +4962,7 @@ index 420fecb..c8a295b 100644 if (tmp_opt.saw_tstamp) { if (tmp_opt.rcv_tsecr) -@@ -107,6 +113,11 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, +@@ -107,6 +113,11 @@ tmp_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp; paws_reject = tcp_paws_reject(&tmp_opt, th->rst); } @@ -5035,7 +4974,7 @@ index 420fecb..c8a295b 100644 } if (tw->tw_substate == TCP_FIN_WAIT2) { -@@ -130,6 +141,16 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, +@@ -130,6 +141,16 @@ if (!th->ack || !after(TCP_SKB_CB(skb)->end_seq, tcptw->tw_rcv_nxt) || TCP_SKB_CB(skb)->end_seq == TCP_SKB_CB(skb)->seq) { @@ -5052,7 +4991,7 @@ index 420fecb..c8a295b 100644 inet_twsk_put(tw); return TCP_TW_SUCCESS; } -@@ -273,6 +294,15 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) +@@ -273,6 +294,15 @@ tcptw->tw_ts_offset = tp->tsoffset; tcptw->tw_last_oow_ack_time = 0; @@ -5068,7 +5007,7 @@ index 420fecb..c8a295b 100644 #if IS_ENABLED(CONFIG_IPV6) if (tw->tw_family == PF_INET6) { struct ipv6_pinfo *np = inet6_sk(sk); -@@ -330,15 +360,18 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) +@@ -330,15 +360,18 @@ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW); } @@ -5088,7 +5027,7 @@ index 420fecb..c8a295b 100644 if (twsk->tw_md5_key) kfree_rcu(twsk->tw_md5_key, rcu); #endif -@@ -377,13 +410,14 @@ void tcp_openreq_init_rwin(struct request_sock *req, +@@ -377,13 +410,14 @@ full_space = rcv_wnd * mss; /* tcp_full_space because it is guaranteed to be the first packet */ @@ -5106,7 +5045,7 @@ index 420fecb..c8a295b 100644 ireq->rcv_wscale = rcv_wscale; } EXPORT_SYMBOL(tcp_openreq_init_rwin); -@@ -525,6 +559,8 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, +@@ -525,6 +559,8 @@ newtp->rx_opt.ts_recent_stamp = 0; newtp->tcp_header_len = sizeof(struct tcphdr); } @@ -5115,7 +5054,7 @@ index 420fecb..c8a295b 100644 newtp->tsoffset = treq->ts_off; #ifdef CONFIG_TCP_MD5SIG newtp->md5sig_info = NULL; /*XXX*/ -@@ -563,6 +599,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, +@@ -563,6 +599,7 @@ bool fastopen) { struct tcp_options_received tmp_opt; @@ -5123,7 +5062,7 @@ index 420fecb..c8a295b 100644 struct sock *child; const struct tcphdr *th = tcp_hdr(skb); __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK); -@@ -570,8 +607,11 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, +@@ -570,8 +607,11 @@ bool own_req; tmp_opt.saw_tstamp = 0; @@ -5136,7 +5075,7 @@ index 420fecb..c8a295b 100644 if (tmp_opt.saw_tstamp) { tmp_opt.ts_recent = req->ts_recent; -@@ -612,7 +652,14 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, +@@ -612,7 +652,14 @@ * * Reset timer after retransmitting SYNACK, similar to * the idea of fast retransmit in recovery. @@ -5151,7 +5090,7 @@ index 420fecb..c8a295b 100644 if (!tcp_oow_rate_limited(sock_net(sk), skb, LINUX_MIB_TCPACKSKIPPEDSYNRECV, &tcp_rsk(req)->last_oow_ack_time) && -@@ -765,6 +812,18 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, +@@ -765,6 +812,18 @@ if (!child) goto listen_overflow; @@ -5170,7 +5109,7 @@ index 420fecb..c8a295b 100644 sock_rps_save_rxhash(child, skb); tcp_synack_rtt_meas(child, req); return inet_csk_complete_hashdance(sk, child, req, own_req); -@@ -812,12 +871,13 @@ int tcp_child_process(struct sock *parent, struct sock *child, +@@ -812,12 +871,13 @@ { int ret = 0; int state = child->sk_state; @@ -5185,7 +5124,7 @@ index 420fecb..c8a295b 100644 ret = tcp_rcv_state_process(child, skb); /* Wakeup parent, send SIGIO */ if (state == TCP_SYN_RECV && child->sk_state != state) -@@ -827,10 +887,14 @@ int tcp_child_process(struct sock *parent, struct sock *child, +@@ -827,10 +887,14 @@ * in main socket hash table and lock on listening * socket does not protect us more. */ @@ -5202,10 +5141,9 @@ index 420fecb..c8a295b 100644 sock_put(child); return ret; } -diff --git a/linux-4.14.24/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c -index cd3d60b..f78b339 100644 ---- a/linux-4.14.24/net/ipv4/tcp_output.c -+++ b/net/ipv4/tcp_output.c +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-16 20:53:41.000000000 +0200 @@ -36,6 +36,12 @@ #define pr_fmt(fmt) "TCP: " fmt @@ -5219,7 +5157,7 @@ index cd3d60b..f78b339 100644 #include #include -@@ -62,11 +68,8 @@ int sysctl_tcp_tso_win_divisor __read_mostly = 3; +@@ -62,11 +68,8 @@ /* By default, RFC2861 behavior. */ int sysctl_tcp_slow_start_after_idle __read_mostly = 1; @@ -5232,7 +5170,7 @@ index cd3d60b..f78b339 100644 { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); -@@ -206,7 +209,7 @@ u32 tcp_default_init_rwnd(u32 mss) +@@ -206,7 +209,7 @@ void tcp_select_initial_window(int __space, __u32 mss, __u32 *rcv_wnd, __u32 *window_clamp, int wscale_ok, __u8 *rcv_wscale, @@ -5241,7 +5179,7 @@ index cd3d60b..f78b339 100644 { unsigned int space = (__space < 0 ? 0 : __space); -@@ -260,12 +263,16 @@ EXPORT_SYMBOL(tcp_select_initial_window); +@@ -260,12 +263,16 @@ * value can be stuffed directly into th->window for an outgoing * frame. */ @@ -5261,7 +5199,7 @@ index cd3d60b..f78b339 100644 /* Never shrink the offered window */ if (new_win < cur_win) { -@@ -281,6 +288,7 @@ static u16 tcp_select_window(struct sock *sk) +@@ -281,6 +288,7 @@ LINUX_MIB_TCPWANTZEROWINDOWADV); new_win = ALIGN(cur_win, 1 << tp->rx_opt.rcv_wscale); } @@ -5269,7 +5207,7 @@ index cd3d60b..f78b339 100644 tp->rcv_wnd = new_win; tp->rcv_wup = tp->rcv_nxt; -@@ -392,7 +400,7 @@ static void tcp_ecn_send(struct sock *sk, struct sk_buff *skb, +@@ -392,7 +400,7 @@ /* Constructs common control bits of non-data skb. If SYN/FIN is present, * auto increment end seqno. */ @@ -5278,7 +5216,7 @@ index cd3d60b..f78b339 100644 { skb->ip_summed = CHECKSUM_PARTIAL; skb->csum = 0; -@@ -408,7 +416,7 @@ static void tcp_init_nondata_skb(struct sk_buff *skb, u32 seq, u8 flags) +@@ -408,7 +416,7 @@ TCP_SKB_CB(skb)->end_seq = seq; } @@ -5287,7 +5225,7 @@ index cd3d60b..f78b339 100644 { return tp->snd_una != tp->snd_up; } -@@ -418,17 +426,7 @@ static inline bool tcp_urg_mode(const struct tcp_sock *tp) +@@ -418,17 +426,7 @@ #define OPTION_MD5 (1 << 2) #define OPTION_WSCALE (1 << 3) #define OPTION_FAST_OPEN_COOKIE (1 << 8) @@ -5306,7 +5244,7 @@ index cd3d60b..f78b339 100644 /* Write previously computed TCP options to the packet. * -@@ -444,7 +442,7 @@ struct tcp_out_options { +@@ -444,7 +442,7 @@ * (but it may well be that other scenarios fail similarly). */ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, @@ -5315,7 +5253,7 @@ index cd3d60b..f78b339 100644 { u16 options = opts->options; /* mungable copy */ -@@ -536,6 +534,9 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, +@@ -536,6 +534,9 @@ } ptr += (len + 3) >> 2; } @@ -5325,7 +5263,7 @@ index cd3d60b..f78b339 100644 } /* Compute TCP options for SYN packets. This is not the final -@@ -587,6 +588,8 @@ static unsigned int tcp_syn_options(struct sock *sk, struct sk_buff *skb, +@@ -587,6 +588,8 @@ if (unlikely(!(OPTION_TS & opts->options))) remaining -= TCPOLEN_SACKPERM_ALIGNED; } @@ -5334,7 +5272,7 @@ index cd3d60b..f78b339 100644 if (fastopen && fastopen->cookie.len >= 0) { u32 need = fastopen->cookie.len; -@@ -663,6 +666,9 @@ static unsigned int tcp_synack_options(struct request_sock *req, +@@ -663,6 +666,9 @@ } } @@ -5344,7 +5282,7 @@ index cd3d60b..f78b339 100644 return MAX_TCP_OPTION_SPACE - remaining; } -@@ -695,16 +701,22 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb +@@ -695,16 +701,22 @@ opts->tsecr = tp->rx_opt.ts_recent; size += TCPOLEN_TSTAMP_ALIGNED; } @@ -5374,7 +5312,7 @@ index cd3d60b..f78b339 100644 } return size; -@@ -744,8 +756,8 @@ static void tcp_tsq_handler(struct sock *sk) +@@ -744,8 +756,8 @@ tcp_xmit_retransmit_queue(sk); } @@ -5385,7 +5323,7 @@ index cd3d60b..f78b339 100644 } } /* -@@ -761,7 +773,7 @@ static void tcp_tasklet_func(unsigned long data) +@@ -761,7 +773,7 @@ unsigned long flags; struct list_head *q, *n; struct tcp_sock *tp; @@ -5394,7 +5332,7 @@ index cd3d60b..f78b339 100644 local_irq_save(flags); list_splice_init(&tsq->head, &list); -@@ -775,14 +787,28 @@ static void tcp_tasklet_func(unsigned long data) +@@ -775,14 +787,28 @@ smp_mb__before_atomic(); clear_bit(TSQ_QUEUED, &sk->sk_tsq_flags); @@ -5427,7 +5365,7 @@ index cd3d60b..f78b339 100644 } sk_free(sk); -@@ -792,7 +818,9 @@ static void tcp_tasklet_func(unsigned long data) +@@ -792,7 +818,9 @@ #define TCP_DEFERRED_ALL (TCPF_TSQ_DEFERRED | \ TCPF_WRITE_TIMER_DEFERRED | \ TCPF_DELACK_TIMER_DEFERRED | \ @@ -5438,7 +5376,7 @@ index cd3d60b..f78b339 100644 /** * tcp_release_cb - tcp release_sock() callback * @sk: socket -@@ -812,8 +840,11 @@ void tcp_release_cb(struct sock *sk) +@@ -812,8 +840,11 @@ nflags = flags & ~TCP_DEFERRED_ALL; } while (cmpxchg(&sk->sk_tsq_flags, flags, nflags) != flags); @@ -5451,7 +5389,7 @@ index cd3d60b..f78b339 100644 /* Here begins the tricky part : * We are called from release_sock() with : -@@ -838,6 +869,13 @@ void tcp_release_cb(struct sock *sk) +@@ -838,6 +869,13 @@ inet_csk(sk)->icsk_af_ops->mtu_reduced(sk); __sock_put(sk); } @@ -5465,7 +5403,7 @@ index cd3d60b..f78b339 100644 } EXPORT_SYMBOL(tcp_release_cb); -@@ -984,8 +1022,8 @@ static void tcp_internal_pacing(struct sock *sk, const struct sk_buff *skb) +@@ -984,8 +1022,8 @@ * We are working here with either a clone of the original * SKB, or a fresh unique copy made by the retransmit engine. */ @@ -5476,7 +5414,7 @@ index cd3d60b..f78b339 100644 { const struct inet_connection_sock *icsk = inet_csk(sk); struct inet_sock *inet; -@@ -1075,10 +1113,10 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, +@@ -1075,10 +1113,10 @@ } } @@ -5489,7 +5427,7 @@ index cd3d60b..f78b339 100644 tcp_ecn_send(sk, skb, th, tcp_header_size); } else { /* RFC1323: The window in SYN & SYN/ACK segments -@@ -1140,7 +1178,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, +@@ -1140,7 +1178,7 @@ * NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames, * otherwise socket can stall. */ @@ -5498,7 +5436,7 @@ index cd3d60b..f78b339 100644 { struct tcp_sock *tp = tcp_sk(sk); -@@ -1153,7 +1191,7 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) +@@ -1153,7 +1191,7 @@ } /* Initialize TSO segments for a packet. */ @@ -5507,7 +5445,7 @@ index cd3d60b..f78b339 100644 { if (skb->len <= mss_now || skb->ip_summed == CHECKSUM_NONE) { /* Avoid the costly divide in the normal -@@ -1185,7 +1223,7 @@ static void tcp_adjust_fackets_out(struct sock *sk, const struct sk_buff *skb, +@@ -1185,7 +1223,7 @@ /* Pcount in the middle of the write queue got changed, we need to do various * tweaks to fix counters */ @@ -5516,7 +5454,7 @@ index cd3d60b..f78b339 100644 { struct tcp_sock *tp = tcp_sk(sk); -@@ -1337,7 +1375,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, +@@ -1337,7 +1375,7 @@ /* This is similar to __pskb_pull_tail(). The difference is that pulled * data is not copied, but immediately discarded. */ @@ -5525,7 +5463,7 @@ index cd3d60b..f78b339 100644 { struct skb_shared_info *shinfo; int i, k, eat; -@@ -1560,6 +1598,7 @@ unsigned int tcp_current_mss(struct sock *sk) +@@ -1560,6 +1598,7 @@ return mss_now; } @@ -5533,7 +5471,7 @@ index cd3d60b..f78b339 100644 /* RFC2861, slow part. Adjust cwnd, after it was not full during one rto. * As additional protections, we do not touch cwnd in retransmission phases, -@@ -1583,7 +1622,7 @@ static void tcp_cwnd_application_limited(struct sock *sk) +@@ -1583,7 +1622,7 @@ tp->snd_cwnd_stamp = tcp_jiffies32; } @@ -5542,7 +5480,7 @@ index cd3d60b..f78b339 100644 { const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; struct tcp_sock *tp = tcp_sk(sk); -@@ -1641,8 +1680,8 @@ static bool tcp_minshall_check(const struct tcp_sock *tp) +@@ -1641,8 +1680,8 @@ * But we can avoid doing the divide again given we already have * skb_pcount = skb->len / mss_now */ @@ -5553,7 +5491,7 @@ index cd3d60b..f78b339 100644 { if (skb->len < tcp_skb_pcount(skb) * mss_now) tp->snd_sml = TCP_SKB_CB(skb)->end_seq; -@@ -1698,11 +1737,11 @@ static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now) +@@ -1700,11 +1739,11 @@ } /* Returns the portion of skb which can be sent right away */ @@ -5570,7 +5508,7 @@ index cd3d60b..f78b339 100644 { const struct tcp_sock *tp = tcp_sk(sk); u32 partial, needed, window, max_len; -@@ -1732,13 +1771,14 @@ static unsigned int tcp_mss_split_point(const struct sock *sk, +@@ -1734,13 +1773,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. */ @@ -5588,7 +5526,7 @@ index cd3d60b..f78b339 100644 tcp_skb_pcount(skb) == 1) return 1; -@@ -1758,7 +1798,7 @@ static inline unsigned int tcp_cwnd_test(const struct tcp_sock *tp, +@@ -1760,7 +1800,7 @@ * This must be invoked the first time we consider transmitting * SKB onto the wire. */ @@ -5597,7 +5535,7 @@ index cd3d60b..f78b339 100644 { int tso_segs = tcp_skb_pcount(skb); -@@ -1773,8 +1813,8 @@ static int tcp_init_tso_segs(struct sk_buff *skb, unsigned int mss_now) +@@ -1775,8 +1815,8 @@ /* Return true if the Nagle test allows this packet to be * sent now. */ @@ -5608,7 +5546,7 @@ index cd3d60b..f78b339 100644 { /* Nagle rule does not apply to frames, which sit in the middle of the * write_queue (they have no chances to get new data). -@@ -1786,7 +1826,8 @@ static inline bool tcp_nagle_test(const struct tcp_sock *tp, const struct sk_buf +@@ -1788,7 +1828,8 @@ return true; /* Don't use the nagle rule for urgent data (or for the final FIN). */ @@ -5618,7 +5556,7 @@ index cd3d60b..f78b339 100644 return true; if (!tcp_nagle_check(skb->len < cur_mss, tp, nonagle)) -@@ -1796,9 +1837,8 @@ static inline bool tcp_nagle_test(const struct tcp_sock *tp, const struct sk_buf +@@ -1798,9 +1839,8 @@ } /* Does at least the first segment of SKB fit into the send window? */ @@ -5630,7 +5568,7 @@ index cd3d60b..f78b339 100644 { u32 end_seq = TCP_SKB_CB(skb)->end_seq; -@@ -1879,7 +1919,7 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb, +@@ -1881,7 +1921,7 @@ struct sk_buff *head; int win_divisor; @@ -5639,7 +5577,7 @@ index cd3d60b..f78b339 100644 goto send_now; if (icsk->icsk_ca_state >= TCP_CA_Recovery) -@@ -2227,7 +2267,7 @@ void tcp_chrono_stop(struct sock *sk, const enum tcp_chrono type) +@@ -2254,7 +2294,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. */ @@ -5648,7 +5586,7 @@ index cd3d60b..f78b339 100644 int push_one, gfp_t gfp) { struct tcp_sock *tp = tcp_sk(sk); -@@ -2241,7 +2281,12 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, +@@ -2268,7 +2308,12 @@ sent_pkts = 0; tcp_mstamp_refresh(tp); @@ -5662,7 +5600,7 @@ index cd3d60b..f78b339 100644 /* Do MTU probing. */ result = tcp_mtu_probe(sk); if (!result) { -@@ -2339,7 +2384,8 @@ repair: +@@ -2366,7 +2411,8 @@ if (push_one != 2) tcp_schedule_loss_probe(sk, false); is_cwnd_limited |= (tcp_packets_in_flight(tp) >= tp->snd_cwnd); @@ -5672,7 +5610,7 @@ index cd3d60b..f78b339 100644 return false; } return !tp->packets_out && tcp_send_head(sk); -@@ -2424,7 +2470,7 @@ void tcp_send_loss_probe(struct sock *sk) +@@ -2451,7 +2497,7 @@ if (skb) { if (tcp_snd_wnd_test(tp, skb, mss)) { pcount = tp->packets_out; @@ -5681,7 +5619,7 @@ index cd3d60b..f78b339 100644 if (tp->packets_out > pcount) goto probe_sent; goto rearm_timer; -@@ -2487,8 +2533,8 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, +@@ -2514,8 +2560,8 @@ if (unlikely(sk->sk_state == TCP_CLOSE)) return; @@ -5692,7 +5630,7 @@ index cd3d60b..f78b339 100644 tcp_check_probe_timer(sk); } -@@ -2501,7 +2547,8 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now) +@@ -2528,7 +2574,8 @@ BUG_ON(!skb || skb->len < mss_now); @@ -5702,7 +5640,7 @@ index cd3d60b..f78b339 100644 } /* This function returns the amount that we can raise the -@@ -2734,6 +2781,10 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *to, +@@ -2761,6 +2808,10 @@ if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) return; @@ -5713,7 +5651,7 @@ index cd3d60b..f78b339 100644 tcp_for_write_queue_from_safe(skb, tmp, sk) { if (!tcp_can_collapse(sk, skb)) break; -@@ -3189,7 +3240,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst, +@@ -3216,7 +3267,7 @@ /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ th->window = htons(min(req->rsk_rcv_wnd, 65535U)); @@ -5722,7 +5660,7 @@ index cd3d60b..f78b339 100644 th->doff = (tcp_header_size >> 2); __TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); -@@ -3270,13 +3321,13 @@ static void tcp_connect_init(struct sock *sk) +@@ -3297,13 +3348,13 @@ if (rcv_wnd == 0) rcv_wnd = dst_metric(dst, RTAX_INITRWND); @@ -5743,7 +5681,7 @@ index cd3d60b..f78b339 100644 tp->rx_opt.rcv_wscale = rcv_wscale; tp->rcv_ssthresh = tp->rcv_wnd; -@@ -3300,6 +3351,36 @@ static void tcp_connect_init(struct sock *sk) +@@ -3327,6 +3378,36 @@ inet_csk(sk)->icsk_rto = tcp_timeout_init(sk); inet_csk(sk)->icsk_retransmits = 0; tcp_clear_retrans(tp); @@ -5780,7 +5718,7 @@ index cd3d60b..f78b339 100644 } static void tcp_connect_queue_skb(struct sock *sk, struct sk_buff *skb) -@@ -3571,7 +3652,7 @@ EXPORT_SYMBOL_GPL(tcp_send_ack); +@@ -3598,7 +3679,7 @@ * one is with SEG.SEQ=SND.UNA to deliver urgent pointer, another is * out-of-date with SND.UNA-1 to probe window. */ @@ -5789,7 +5727,7 @@ index cd3d60b..f78b339 100644 { struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb; -@@ -3657,7 +3738,7 @@ void tcp_send_probe0(struct sock *sk) +@@ -3684,7 +3765,7 @@ unsigned long probe_max; int err; @@ -5798,10 +5736,9 @@ index cd3d60b..f78b339 100644 if (tp->packets_out || !tcp_send_head(sk)) { /* Cancel probe timer, if it is not required. */ -diff --git a/linux-4.14.24/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c -index 14ac7df..fe2c79d 100644 ---- a/linux-4.14.24/net/ipv4/tcp_timer.c -+++ b/net/ipv4/tcp_timer.c +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-16 20:53:41.000000000 +0200 @@ -20,6 +20,7 @@ #include @@ -5810,7 +5747,7 @@ index 14ac7df..fe2c79d 100644 #include int sysctl_tcp_thin_linear_timeouts __read_mostly; -@@ -31,7 +32,7 @@ int sysctl_tcp_thin_linear_timeouts __read_mostly; +@@ -31,7 +32,7 @@ * Returns: Nothing (void) */ @@ -5819,7 +5756,7 @@ index 14ac7df..fe2c79d 100644 { sk->sk_err = sk->sk_err_soft ? : ETIMEDOUT; sk->sk_error_report(sk); -@@ -86,7 +87,7 @@ static int tcp_out_of_resources(struct sock *sk, bool do_reset) +@@ -87,7 +88,7 @@ (!tp->snd_wnd && !tp->packets_out)) do_reset = true; if (do_reset) @@ -5828,7 +5765,7 @@ index 14ac7df..fe2c79d 100644 tcp_done(sk); __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY); return 1; -@@ -160,9 +161,9 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk) +@@ -161,9 +162,9 @@ * after "boundary" unsuccessful, exponentially backed-off * retransmissions with an initial RTO of TCP_RTO_MIN. */ @@ -5841,7 +5778,7 @@ index 14ac7df..fe2c79d 100644 { const unsigned int rto_base = TCP_RTO_MIN; unsigned int linear_backoff_thresh, start_ts; -@@ -187,7 +188,7 @@ static bool retransmits_timed_out(struct sock *sk, +@@ -188,7 +189,7 @@ } /* A write timeout has occurred. Process the after effects. */ @@ -5850,7 +5787,7 @@ index 14ac7df..fe2c79d 100644 { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); -@@ -207,6 +208,17 @@ static int tcp_write_timeout(struct sock *sk) +@@ -208,6 +209,17 @@ sk_rethink_txhash(sk); } retry_until = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_syn_retries; @@ -5868,7 +5805,7 @@ index 14ac7df..fe2c79d 100644 expired = icsk->icsk_retransmits >= retry_until; } else { if (retransmits_timed_out(sk, net->ipv4.sysctl_tcp_retries1, 0)) { -@@ -302,18 +314,22 @@ out: +@@ -303,18 +315,22 @@ static void tcp_delack_timer(unsigned long data) { struct sock *sk = (struct sock *)data; @@ -5895,7 +5832,7 @@ index 14ac7df..fe2c79d 100644 sock_put(sk); } -@@ -574,7 +590,7 @@ void tcp_write_timer_handler(struct sock *sk) +@@ -575,7 +591,7 @@ break; case ICSK_TIME_RETRANS: icsk->icsk_pending = 0; @@ -5904,7 +5841,7 @@ index 14ac7df..fe2c79d 100644 break; case ICSK_TIME_PROBE0: icsk->icsk_pending = 0; -@@ -589,16 +605,19 @@ out: +@@ -590,16 +606,19 @@ static void tcp_write_timer(unsigned long data) { struct sock *sk = (struct sock *)data; @@ -5927,7 +5864,7 @@ index 14ac7df..fe2c79d 100644 sock_put(sk); } -@@ -628,11 +647,12 @@ static void tcp_keepalive_timer (unsigned long data) +@@ -629,11 +648,12 @@ struct sock *sk = (struct sock *) data; struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); @@ -5942,7 +5879,7 @@ index 14ac7df..fe2c79d 100644 /* Try again later. */ inet_csk_reset_keepalive_timer (sk, HZ/20); goto out; -@@ -644,16 +664,31 @@ static void tcp_keepalive_timer (unsigned long data) +@@ -645,16 +665,31 @@ } tcp_mstamp_refresh(tp); @@ -5976,7 +5913,7 @@ index 14ac7df..fe2c79d 100644 goto death; } -@@ -678,11 +713,11 @@ static void tcp_keepalive_timer (unsigned long data) +@@ -679,11 +714,11 @@ icsk->icsk_probes_out > 0) || (icsk->icsk_user_timeout == 0 && icsk->icsk_probes_out >= keepalive_probes(tp))) { @@ -5990,7 +5927,7 @@ index 14ac7df..fe2c79d 100644 icsk->icsk_probes_out++; elapsed = keepalive_intvl_when(tp); } else { -@@ -706,7 +741,7 @@ death: +@@ -707,7 +742,7 @@ tcp_done(sk); out: @@ -5999,11 +5936,10 @@ index 14ac7df..fe2c79d 100644 sock_put(sk); } -diff --git a/linux-4.14.24/net/ipv6/addrconf.c b/net/ipv6/addrconf.c -index 6a76e41..b9ad831 100644 ---- a/linux-4.14.24/net/ipv6/addrconf.c -+++ b/net/ipv6/addrconf.c -@@ -928,6 +928,7 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp) +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-16 20:53:41.000000000 +0200 +@@ -928,6 +928,7 @@ kfree_rcu(ifp, rcu); } @@ -6011,11 +5947,10 @@ index 6a76e41..b9ad831 100644 static void ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) -diff --git a/linux-4.14.24/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c -index 9ccbf74..f5d6839 100644 ---- a/linux-4.14.24/net/ipv6/af_inet6.c -+++ b/net/ipv6/af_inet6.c -@@ -107,8 +107,7 @@ static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) +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-16 20:53:41.000000000 +0200 +@@ -107,8 +107,7 @@ return (struct ipv6_pinfo *)(((u8 *)sk) + offset); } @@ -6025,10 +5960,9 @@ index 9ccbf74..f5d6839 100644 { struct inet_sock *inet; struct ipv6_pinfo *np; -diff --git a/linux-4.14.24/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c -index 1276d5b..4214117 100644 ---- a/linux-4.14.24/net/ipv6/ipv6_sockglue.c -+++ b/net/ipv6/ipv6_sockglue.c +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-16 20:53:41.000000000 +0200 @@ -48,6 +48,8 @@ #include #include @@ -6038,7 +5972,7 @@ index 1276d5b..4214117 100644 #include #include #include -@@ -216,7 +218,12 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, +@@ -216,7 +218,12 @@ sock_prot_inuse_add(net, &tcp_prot, 1); local_bh_enable(); sk->sk_prot = &tcp_prot; @@ -6052,10 +5986,9 @@ index 1276d5b..4214117 100644 sk->sk_socket->ops = &inet_stream_ops; sk->sk_family = PF_INET; tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); -diff --git a/linux-4.14.24/net/ipv6/syncookies.c b/net/ipv6/syncookies.c -index 4e7817a..063542f 100644 ---- a/linux-4.14.24/net/ipv6/syncookies.c -+++ b/net/ipv6/syncookies.c +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-16 20:53:41.000000000 +0200 @@ -20,6 +20,8 @@ #include #include @@ -6065,7 +5998,7 @@ index 4e7817a..063542f 100644 #include #define COOKIEBITS 24 /* Upper bits store count */ -@@ -111,7 +113,8 @@ u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, +@@ -111,7 +113,8 @@ } EXPORT_SYMBOL_GPL(__cookie_v6_init_sequence); @@ -6075,7 +6008,7 @@ index 4e7817a..063542f 100644 { const struct ipv6hdr *iph = ipv6_hdr(skb); const struct tcphdr *th = tcp_hdr(skb); -@@ -133,6 +136,7 @@ EXPORT_SYMBOL_GPL(__cookie_v6_check); +@@ -133,6 +136,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) { struct tcp_options_received tcp_opt; @@ -6083,7 +6016,7 @@ index 4e7817a..063542f 100644 struct inet_request_sock *ireq; struct tcp_request_sock *treq; struct ipv6_pinfo *np = inet6_sk(sk); -@@ -162,7 +166,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) +@@ -162,7 +166,8 @@ /* check for timestamp cookie support */ memset(&tcp_opt, 0, sizeof(tcp_opt)); @@ -6093,7 +6026,7 @@ index 4e7817a..063542f 100644 if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) { tsoff = secure_tcpv6_ts_off(sock_net(sk), -@@ -175,14 +180,27 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) +@@ -175,14 +180,27 @@ goto out; ret = NULL; @@ -6122,7 +6055,7 @@ index 4e7817a..063542f 100644 if (security_inet_conn_request(sk, skb, req)) goto out_free; -@@ -244,10 +262,10 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) +@@ -244,10 +262,10 @@ } req->rsk_window_clamp = tp->window_clamp ? :dst_metric(dst, RTAX_WINDOW); @@ -6137,10 +6070,9 @@ index 4e7817a..063542f 100644 ireq->rcv_wscale = rcv_wscale; ireq->ecn_ok = cookie_ecn_ok(&tcp_opt, sock_net(sk), dst); -diff --git a/linux-4.14.24/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c -index 237cc61..dd86c44 100644 ---- a/linux-4.14.24/net/ipv6/tcp_ipv6.c -+++ b/net/ipv6/tcp_ipv6.c +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-16 20:53:41.000000000 +0200 @@ -61,6 +61,8 @@ #include #include @@ -6165,7 +6097,7 @@ index 237cc61..dd86c44 100644 #ifdef CONFIG_TCP_MD5SIG static const struct tcp_sock_af_ops tcp_sock_ipv6_specific; static const struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific; -@@ -88,7 +82,7 @@ static struct tcp_md5sig_key *tcp_v6_md5_do_lookup(const struct sock *sk, +@@ -88,7 +82,7 @@ } #endif @@ -6174,7 +6106,7 @@ index 237cc61..dd86c44 100644 { struct dst_entry *dst = skb_dst(skb); -@@ -115,7 +109,7 @@ static u32 tcp_v6_init_ts_off(const struct net *net, const struct sk_buff *skb) +@@ -115,7 +109,7 @@ ipv6_hdr(skb)->saddr.s6_addr32); } @@ -6183,7 +6115,7 @@ index 237cc61..dd86c44 100644 int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; -@@ -213,7 +207,12 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, +@@ -213,7 +207,12 @@ sin.sin_port = usin->sin6_port; sin.sin_addr.s_addr = usin->sin6_addr.s6_addr32[3]; @@ -6197,7 +6129,7 @@ index 237cc61..dd86c44 100644 sk->sk_backlog_rcv = tcp_v4_do_rcv; #ifdef CONFIG_TCP_MD5SIG tp->af_specific = &tcp_sock_ipv6_mapped_specific; -@@ -223,7 +222,12 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, +@@ -223,7 +222,12 @@ if (err) { icsk->icsk_ext_hdr_len = exthdrlen; @@ -6211,7 +6143,7 @@ index 237cc61..dd86c44 100644 sk->sk_backlog_rcv = tcp_v6_do_rcv; #ifdef CONFIG_TCP_MD5SIG tp->af_specific = &tcp_sock_ipv6_specific; -@@ -316,7 +320,7 @@ failure: +@@ -316,7 +320,7 @@ return err; } @@ -6220,7 +6152,7 @@ index 237cc61..dd86c44 100644 { struct dst_entry *dst; -@@ -343,7 +347,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -343,7 +347,7 @@ struct ipv6_pinfo *np; struct tcp_sock *tp; __u32 seq, snd_una; @@ -6229,7 +6161,7 @@ index 237cc61..dd86c44 100644 bool fatal; int err; -@@ -367,8 +371,14 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -367,8 +371,14 @@ if (sk->sk_state == TCP_NEW_SYN_RECV) return tcp_req_err(sk, seq, fatal); @@ -6246,7 +6178,7 @@ index 237cc61..dd86c44 100644 __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS); if (sk->sk_state == TCP_CLOSE) -@@ -379,7 +389,6 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -379,7 +389,6 @@ goto out; } @@ -6254,7 +6186,7 @@ index 237cc61..dd86c44 100644 /* XXX (TFO) - tp->snd_una should be ISN (tcp_create_openreq_child() */ fastopen = tp->fastopen_rsk; snd_una = fastopen ? tcp_rsk(fastopen)->snt_isn : tp->snd_una; -@@ -413,11 +422,15 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -413,11 +422,15 @@ goto out; tp->mtu_info = ntohl(info); @@ -6274,7 +6206,7 @@ index 237cc61..dd86c44 100644 goto out; } -@@ -432,7 +445,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -432,7 +445,7 @@ if (fastopen && !fastopen->sk) break; @@ -6283,7 +6215,7 @@ index 237cc61..dd86c44 100644 sk->sk_err = err; sk->sk_error_report(sk); /* Wake people up to see the error (see connect in sock.c) */ -@@ -442,14 +455,14 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +@@ -442,14 +455,14 @@ goto out; } @@ -6300,7 +6232,7 @@ index 237cc61..dd86c44 100644 sock_put(sk); } -@@ -495,8 +508,7 @@ done: +@@ -495,8 +508,7 @@ return err; } @@ -6310,7 +6242,7 @@ index 237cc61..dd86c44 100644 { kfree(inet_rsk(req)->ipv6_opt); kfree_skb(inet_rsk(req)->pktopts); -@@ -714,9 +726,10 @@ static bool tcp_v6_inbound_md5_hash(const struct sock *sk, +@@ -714,9 +726,10 @@ return false; } @@ -6324,7 +6256,7 @@ index 237cc61..dd86c44 100644 { struct inet_request_sock *ireq = inet_rsk(req); const struct ipv6_pinfo *np = inet6_sk(sk_listener); -@@ -737,6 +750,8 @@ static void tcp_v6_init_req(struct request_sock *req, +@@ -737,6 +750,8 @@ refcount_inc(&skb->users); ireq->pktopts = skb; } @@ -6333,7 +6265,7 @@ index 237cc61..dd86c44 100644 } static struct dst_entry *tcp_v6_route_req(const struct sock *sk, -@@ -756,7 +771,7 @@ struct request_sock_ops tcp6_request_sock_ops __read_mostly = { +@@ -756,7 +771,7 @@ .syn_ack_timeout = tcp_syn_ack_timeout, }; @@ -6342,7 +6274,7 @@ index 237cc61..dd86c44 100644 .mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr), #ifdef CONFIG_TCP_MD5SIG -@@ -774,9 +789,9 @@ static const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { +@@ -774,9 +789,9 @@ }; static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 seq, @@ -6354,7 +6286,7 @@ index 237cc61..dd86c44 100644 { const struct tcphdr *th = tcp_hdr(skb); struct tcphdr *t1; -@@ -794,7 +809,10 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 +@@ -794,7 +809,10 @@ if (key) tot_len += TCPOLEN_MD5SIG_ALIGNED; #endif @@ -6366,7 +6298,7 @@ index 237cc61..dd86c44 100644 buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len, GFP_ATOMIC); if (!buff) -@@ -832,6 +850,17 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 +@@ -832,6 +850,17 @@ tcp_v6_md5_hash_hdr((__u8 *)topt, key, &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, t1); @@ -6384,7 +6316,7 @@ index 237cc61..dd86c44 100644 } #endif -@@ -878,7 +907,7 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 +@@ -878,7 +907,7 @@ kfree_skb(buff); } @@ -6393,7 +6325,7 @@ index 237cc61..dd86c44 100644 { const struct tcphdr *th = tcp_hdr(skb); u32 seq = 0, ack_seq = 0; -@@ -940,7 +969,7 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb) +@@ -940,7 +969,7 @@ (th->doff << 2); oif = sk ? sk->sk_bound_dev_if : 0; @@ -6402,7 +6334,7 @@ index 237cc61..dd86c44 100644 #ifdef CONFIG_TCP_MD5SIG out: -@@ -949,30 +978,37 @@ out: +@@ -949,30 +978,37 @@ } static void tcp_v6_send_ack(const struct sock *sk, struct sk_buff *skb, u32 seq, @@ -6447,7 +6379,7 @@ index 237cc61..dd86c44 100644 { /* sk->sk_state == TCP_LISTEN -> for regular TCP_SYN_RECV * sk->sk_state == TCP_SYN_RECV -> for Fast Open. -@@ -982,18 +1018,18 @@ static void tcp_v6_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, +@@ -982,18 +1018,18 @@ * exception of segments, MUST be right-shifted by * Rcv.Wind.Shift bits: */ @@ -6470,7 +6402,7 @@ index 237cc61..dd86c44 100644 { #ifdef CONFIG_SYN_COOKIES const struct tcphdr *th = tcp_hdr(skb); -@@ -1004,7 +1040,7 @@ static struct sock *tcp_v6_cookie_check(struct sock *sk, struct sk_buff *skb) +@@ -1004,7 +1040,7 @@ return sk; } @@ -6479,7 +6411,7 @@ index 237cc61..dd86c44 100644 { if (skb->protocol == htons(ETH_P_IP)) return tcp_v4_conn_request(sk, skb); -@@ -1030,11 +1066,11 @@ static void tcp_v6_restore_cb(struct sk_buff *skb) +@@ -1030,11 +1066,11 @@ sizeof(struct inet6_skb_parm)); } @@ -6496,7 +6428,7 @@ index 237cc61..dd86c44 100644 { struct inet_request_sock *ireq; struct ipv6_pinfo *newnp; -@@ -1071,7 +1107,15 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff * +@@ -1071,7 +1107,15 @@ newnp->saddr = newsk->sk_v6_rcv_saddr; @@ -6513,7 +6445,7 @@ index 237cc61..dd86c44 100644 newsk->sk_backlog_rcv = tcp_v4_do_rcv; #ifdef CONFIG_TCP_MD5SIG newtp->af_specific = &tcp_sock_ipv6_mapped_specific; -@@ -1118,6 +1162,14 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff * +@@ -1118,6 +1162,14 @@ if (!newsk) goto out_nonewsk; @@ -6528,7 +6460,7 @@ index 237cc61..dd86c44 100644 /* * No need to charge this sock to the relevant IPv6 refcnt debug socks * count here, tcp_create_openreq_child now does this for us, see the -@@ -1246,7 +1298,7 @@ out: +@@ -1246,7 +1298,7 @@ * This is because we cannot sleep with the original spinlock * held. */ @@ -6537,7 +6469,7 @@ index 237cc61..dd86c44 100644 { struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_sock *tp; -@@ -1263,6 +1315,9 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) +@@ -1263,6 +1315,9 @@ if (skb->protocol == htons(ETH_P_IP)) return tcp_v4_do_rcv(sk, skb); @@ -6547,7 +6479,7 @@ index 237cc61..dd86c44 100644 /* * socket locking is here for SMP purposes as backlog rcv * is currently called with bh processing disabled. -@@ -1390,6 +1445,10 @@ static void tcp_v6_fill_cb(struct sk_buff *skb, const struct ipv6hdr *hdr, +@@ -1390,6 +1445,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); @@ -6558,7 +6490,7 @@ index 237cc61..dd86c44 100644 TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th); TCP_SKB_CB(skb)->tcp_tw_isn = 0; TCP_SKB_CB(skb)->ip_dsfield = ipv6_get_dsfield(hdr); -@@ -1403,8 +1462,8 @@ static int tcp_v6_rcv(struct sk_buff *skb) +@@ -1403,8 +1462,8 @@ int sdif = inet6_sdif(skb); const struct tcphdr *th; const struct ipv6hdr *hdr; @@ -6568,7 +6500,7 @@ index 237cc61..dd86c44 100644 int ret; struct net *net = dev_net(skb->dev); -@@ -1453,12 +1512,42 @@ process: +@@ -1453,12 +1512,42 @@ reqsk_put(req); goto discard_it; } @@ -6612,7 +6544,7 @@ index 237cc61..dd86c44 100644 nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; -@@ -1468,10 +1557,14 @@ process: +@@ -1468,10 +1557,14 @@ } if (!nsk) { reqsk_put(req); @@ -6627,7 +6559,7 @@ index 237cc61..dd86c44 100644 tcp_v6_restore_cb(skb); } else if (tcp_child_process(sk, nsk, skb)) { tcp_v6_send_reset(nsk, skb); -@@ -1481,6 +1574,7 @@ process: +@@ -1481,6 +1574,7 @@ return 0; } } @@ -6635,7 +6567,7 @@ index 237cc61..dd86c44 100644 if (hdr->hop_limit < inet6_sk(sk)->min_hopcount) { __NET_INC_STATS(net, LINUX_MIB_TCPMINTTLDROP); goto discard_and_relse; -@@ -1507,15 +1601,25 @@ process: +@@ -1507,15 +1601,25 @@ sk_incoming_cpu_update(sk); @@ -6665,7 +6597,7 @@ index 237cc61..dd86c44 100644 put_and_return: if (refcounted) -@@ -1528,6 +1632,19 @@ no_tcp_socket: +@@ -1528,6 +1632,19 @@ tcp_v6_fill_cb(skb, hdr, th); @@ -6685,7 +6617,7 @@ index 237cc61..dd86c44 100644 if (tcp_checksum_complete(skb)) { csum_error: __TCP_INC_STATS(net, TCP_MIB_CSUMERRORS); -@@ -1579,6 +1696,18 @@ do_time_wait: +@@ -1579,6 +1696,18 @@ refcounted = false; goto process; } @@ -6704,7 +6636,7 @@ index 237cc61..dd86c44 100644 /* Fall through to ACK */ } case TCP_TW_ACK: -@@ -1632,13 +1761,13 @@ static void tcp_v6_early_demux(struct sk_buff *skb) +@@ -1632,13 +1761,13 @@ } } @@ -6720,7 +6652,7 @@ index 237cc61..dd86c44 100644 .queue_xmit = inet6_csk_xmit, .send_check = tcp_v6_send_check, .rebuild_header = inet6_sk_rebuild_header, -@@ -1669,7 +1798,7 @@ static const struct tcp_sock_af_ops tcp_sock_ipv6_specific = { +@@ -1669,7 +1798,7 @@ /* * TCP over IPv4 via INET6 API */ @@ -6729,7 +6661,7 @@ index 237cc61..dd86c44 100644 .queue_xmit = ip_queue_xmit, .send_check = tcp_v4_send_check, .rebuild_header = inet_sk_rebuild_header, -@@ -1705,7 +1834,12 @@ static int tcp_v6_init_sock(struct sock *sk) +@@ -1705,7 +1834,12 @@ tcp_init_sock(sk); @@ -6743,7 +6675,7 @@ index 237cc61..dd86c44 100644 #ifdef CONFIG_TCP_MD5SIG tcp_sk(sk)->af_specific = &tcp_sock_ipv6_specific; -@@ -1714,7 +1848,7 @@ static int tcp_v6_init_sock(struct sock *sk) +@@ -1714,7 +1848,7 @@ return 0; } @@ -6752,7 +6684,7 @@ index 237cc61..dd86c44 100644 { tcp_v4_destroy_sock(sk); inet6_destroy_sock(sk); -@@ -1948,6 +2082,9 @@ struct proto tcpv6_prot = { +@@ -1948,6 +2082,9 @@ .compat_getsockopt = compat_tcp_getsockopt, #endif .diag_destroy = tcp_abort, @@ -6762,11 +6694,31 @@ index 237cc61..dd86c44 100644 }; /* thinking of making this const? Don't. -diff --git a/mptcp/net/mptcp/Kconfig b/net/mptcp/Kconfig -new file mode 100644 -index 0000000..13cf4d5 ---- /dev/null -+++ b/net/mptcp/Kconfig +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-16 20:53:41.000000000 +0200 +@@ -88,6 +88,7 @@ + source "net/ipv4/Kconfig" + source "net/ipv6/Kconfig" + source "net/netlabel/Kconfig" ++source "net/mptcp/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-16 20:53:41.000000000 +0200 +@@ -20,6 +20,7 @@ + obj-$(CONFIG_XFRM) += xfrm/ + obj-$(CONFIG_UNIX) += unix/ + obj-$(CONFIG_NET) += ipv6/ ++obj-$(CONFIG_MPTCP) += mptcp/ + 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-16 20:53:41.000000000 +0200 @@ -0,0 +1,129 @@ +# +# MPTCP configuration @@ -6897,11 +6849,9 @@ index 0000000..13cf4d5 + default "redundant" if DEFAULT_REDUNDANT + default "default" + -diff --git a/mptcp/net/mptcp/Makefile b/net/mptcp/Makefile -new file mode 100644 -index 0000000..a38e437 ---- /dev/null -+++ b/net/mptcp/Makefile +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,22 @@ +# +## Makefile for MultiPath TCP support code. @@ -6925,11 +6875,9 @@ index 0000000..a38e437 + +mptcp-$(subst m,y,$(CONFIG_IPV6)) += mptcp_ipv6.o + -diff --git a/mptcp/net/mptcp/mptcp_balia.c b/net/mptcp/mptcp_balia.c -new file mode 100644 -index 0000000..73f365b ---- /dev/null -+++ b/net/mptcp/mptcp_balia.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,268 @@ +/* + * MPTCP implementation - Balia Congestion Control @@ -7199,11 +7147,9 @@ index 0000000..73f365b +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP BALIA CONGESTION CONTROL ALGORITHM"); +MODULE_VERSION("0.1"); -diff --git a/mptcp/net/mptcp/mptcp_binder.c b/net/mptcp/mptcp_binder.c -new file mode 100644 -index 0000000..58a342d ---- /dev/null -+++ b/net/mptcp/mptcp_binder.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,486 @@ +#include + @@ -7691,11 +7637,9 @@ index 0000000..58a342d +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("BINDER MPTCP"); +MODULE_VERSION("0.1"); -diff --git a/mptcp/net/mptcp/mptcp_coupled.c b/net/mptcp/mptcp_coupled.c -new file mode 100644 -index 0000000..9d97947 ---- /dev/null -+++ b/net/mptcp/mptcp_coupled.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,271 @@ +/* + * MPTCP implementation - Linked Increase congestion control Algorithm (LIA) @@ -7968,11 +7912,9 @@ index 0000000..9d97947 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP LINKED INCREASE CONGESTION CONTROL ALGORITHM"); +MODULE_VERSION("0.1"); -diff --git a/mptcp/net/mptcp/mptcp_ctrl.c b/net/mptcp/mptcp_ctrl.c -new file mode 100644 -index 0000000..797b91f ---- /dev/null -+++ b/net/mptcp/mptcp_ctrl.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,2906 @@ +/* + * MPTCP implementation - MPTCP-control @@ -10040,6 +9982,7 @@ index 0000000..797b91f + struct mptcp_cb *mpcb = tcp_sk(meta_sk)->mpcb; + u8 hash_mac_check[20]; + ++ child_tp->out_of_order_queue = RB_ROOT; + child_tp->inside_tk_table = 0; + + if (!mopt->join_ack) { @@ -10094,7 +10037,6 @@ index 0000000..797b91f + child_tp->mptcp->init_rcv_wnd = req->rsk_rcv_wnd; + + child->sk_tsq_flags = 0; -+ child_tp->out_of_order_queue = RB_ROOT; + + sock_rps_save_rxhash(child, skb); + tcp_synack_rtt_meas(child, req); @@ -10880,11 +10822,9 @@ index 0000000..797b91f +mptcp_sock_cache_failed: + mptcp_init_failed = true; +} -diff --git a/mptcp/net/mptcp/mptcp_fullmesh.c b/net/mptcp/mptcp_fullmesh.c -new file mode 100644 -index 0000000..7dce703 ---- /dev/null -+++ b/net/mptcp/mptcp_fullmesh.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,2013 @@ +#include +#include @@ -12191,9 +12131,9 @@ index 0000000..7dce703 + struct fullmesh_priv *fmp = fullmesh_get_priv(mpcb); + const struct mptcp_fm_ns *fm_ns = fm_get_ns(sock_net(meta_sk)); + struct tcp_sock *master_tp = tcp_sk(mpcb->master_sk); -+ int i, index, if_idx; ++ int i, index, if_idx = 0; + union inet_addr saddr, daddr; -+ sa_family_t family; ++ sa_family_t family = AF_INET; + bool meta_v4 = meta_sk->sk_family == AF_INET; + + /* Init local variables necessary for the rest */ @@ -12899,11 +12839,9 @@ index 0000000..7dce703 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Full-Mesh MPTCP"); +MODULE_VERSION("0.88"); -diff --git a/mptcp/net/mptcp/mptcp_input.c b/net/mptcp/mptcp_input.c -new file mode 100644 -index 0000000..1e73b4e ---- /dev/null -+++ b/net/mptcp/mptcp_input.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,2467 @@ +/* + * MPTCP implementation - Sending side @@ -15372,11 +15310,9 @@ index 0000000..1e73b4e + tcp_set_rto(sk); + mptcp_set_rto(sk); +} -diff --git a/mptcp/net/mptcp/mptcp_ipv4.c b/net/mptcp/mptcp_ipv4.c -new file mode 100644 -index 0000000..a08ade4 ---- /dev/null -+++ b/net/mptcp/mptcp_ipv4.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,437 @@ +/* + * MPTCP implementation - IPv4-specific functions @@ -15815,11 +15751,9 @@ index 0000000..a08ade4 + kmem_cache_destroy(mptcp_request_sock_ops.slab); + kfree(mptcp_request_sock_ops.slab_name); +} -diff --git a/mptcp/net/mptcp/mptcp_ipv6.c b/net/mptcp/mptcp_ipv6.c -new file mode 100644 -index 0000000..637a74a ---- /dev/null -+++ b/net/mptcp/mptcp_ipv6.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,465 @@ +/* + * MPTCP implementation - IPv6-specific functions @@ -16286,11 +16220,9 @@ index 0000000..637a74a + kmem_cache_destroy(mptcp6_request_sock_ops.slab); + kfree(mptcp6_request_sock_ops.slab_name); +} -diff --git a/mptcp/net/mptcp/mptcp_ndiffports.c b/net/mptcp/mptcp_ndiffports.c -new file mode 100644 -index 0000000..10147d5 ---- /dev/null -+++ b/net/mptcp/mptcp_ndiffports.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,169 @@ +#include + @@ -16461,11 +16393,9 @@ index 0000000..10147d5 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("NDIFF-PORTS MPTCP"); +MODULE_VERSION("0.88"); -diff --git a/mptcp/net/mptcp/mptcp_olia.c b/net/mptcp/mptcp_olia.c -new file mode 100644 -index 0000000..201b595 ---- /dev/null -+++ b/net/mptcp/mptcp_olia.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,310 @@ +/* + * MPTCP implementation - OPPORTUNISTIC LINKED INCREASES CONGESTION CONTROL: @@ -16777,11 +16707,9 @@ index 0000000..201b595 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP COUPLED CONGESTION CONTROL"); +MODULE_VERSION("0.1"); -diff --git a/mptcp/net/mptcp/mptcp_output.c b/net/mptcp/mptcp_output.c -new file mode 100644 -index 0000000..49e947c ---- /dev/null -+++ b/net/mptcp/mptcp_output.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,1813 @@ +/* + * MPTCP implementation - Sending side @@ -18596,11 +18524,9 @@ index 0000000..49e947c + return max(xmit_size_goal, mss_now); +} + -diff --git a/mptcp/net/mptcp/mptcp_pm.c b/net/mptcp/mptcp_pm.c -new file mode 100644 -index 0000000..08e3f05 ---- /dev/null -+++ b/net/mptcp/mptcp_pm.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,226 @@ +/* + * MPTCP implementation - MPTCP-subflow-management @@ -18828,11 +18754,9 @@ index 0000000..08e3f05 + return mptcp_set_default_path_manager(CONFIG_DEFAULT_MPTCP_PM); +} +late_initcall(mptcp_path_manager_default); -diff --git a/mptcp/net/mptcp/mptcp_redundant.c b/net/mptcp/mptcp_redundant.c -new file mode 100644 -index 0000000..001a3f8 ---- /dev/null -+++ b/net/mptcp/mptcp_redundant.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,301 @@ +/* + * MPTCP Scheduler to reduce latency and jitter. @@ -19135,11 +19059,9 @@ index 0000000..001a3f8 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("REDUNDANT MPTCP"); +MODULE_VERSION("0.90"); -diff --git a/mptcp/net/mptcp/mptcp_rr.c b/net/mptcp/mptcp_rr.c -new file mode 100644 -index 0000000..8910ba9 ---- /dev/null -+++ b/net/mptcp/mptcp_rr.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,301 @@ +/* MPTCP Scheduler module selector. Highly inspired by tcp_cong.c */ + @@ -19442,11 +19364,9 @@ index 0000000..8910ba9 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("ROUNDROBIN MPTCP"); +MODULE_VERSION("0.89"); -diff --git a/mptcp/net/mptcp/mptcp_sched.c b/net/mptcp/mptcp_sched.c -new file mode 100644 -index 0000000..0639700 ---- /dev/null -+++ b/net/mptcp/mptcp_sched.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,627 @@ +/* MPTCP Scheduler module selector. Highly inspired by tcp_cong.c */ + @@ -20075,11 +19995,9 @@ index 0000000..0639700 + return mptcp_set_default_scheduler(CONFIG_DEFAULT_MPTCP_SCHED); +} +late_initcall(mptcp_scheduler_default); -diff --git a/mptcp/net/mptcp/mptcp_wvegas.c b/net/mptcp/mptcp_wvegas.c -new file mode 100644 -index 0000000..87a4968 ---- /dev/null -+++ b/net/mptcp/mptcp_wvegas.c +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-16 20:53:41.000000000 +0200 @@ -0,0 +1,270 @@ +/* + * MPTCP implementation - WEIGHTED VEGAS