]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/ipv4/tcp_input.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux.git] / net / ipv4 / tcp_input.c
index 731d3045b50a0fb9a89c887a154db9a3da8c7ddd..97671bff597adb8cd2aab268f344ff3ae41a4ebb 100644 (file)
@@ -6263,6 +6263,11 @@ static inline void pr_drop_req(struct request_sock *req, __u16 port, int family)
  * congestion control: Linux DCTCP asserts ECT on all packets,
  * including SYN, which is most optimal solution; however,
  * others, such as FreeBSD do not.
+ *
+ * Exception: At least one of the reserved bits of the TCP header (th->res1) is
+ * set, indicating the use of a future TCP extension (such as AccECN). See
+ * RFC8311 ยง4.3 which updates RFC3168 to allow the development of such
+ * extensions.
  */
 static void tcp_ecn_create_request(struct request_sock *req,
                                   const struct sk_buff *skb,
@@ -6282,7 +6287,7 @@ static void tcp_ecn_create_request(struct request_sock *req,
        ecn_ok_dst = dst_feature(dst, DST_FEATURE_ECN_MASK);
        ecn_ok = net->ipv4.sysctl_tcp_ecn || ecn_ok_dst;
 
-       if ((!ect && ecn_ok) || tcp_ca_needs_ecn(listen_sk) ||
+       if (((!ect || th->res1) && ecn_ok) || tcp_ca_needs_ecn(listen_sk) ||
            (ecn_ok_dst & DST_FEATURE_ECN_CA) ||
            tcp_bpf_ca_needs_ecn((struct sock *)req))
                inet_rsk(req)->ecn_ok = 1;
@@ -6502,8 +6507,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
                        reqsk_fastopen_remove(fastopen_sk, req, false);
                        bh_unlock_sock(fastopen_sk);
                        sock_put(fastopen_sk);
-                       reqsk_put(req);
-                       goto drop;
+                       goto drop_and_free;
                }
                sk->sk_data_ready(sk);
                bh_unlock_sock(fastopen_sk);
@@ -6527,7 +6531,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
 drop_and_release:
        dst_release(dst);
 drop_and_free:
-       reqsk_free(req);
+       __reqsk_free(req);
 drop:
        tcp_listendrop(sk);
        return 0;