diff options
author | Florian Westphal <fw@strlen.de> | 2014-09-29 07:08:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-29 14:41:22 -0400 |
commit | d82bd1229885d550d03926cfa937703f6caa3cc0 (patch) | |
tree | 9630083c9e9da59a31b26722a00a6e9a9f5162b7 /include/net | |
parent | 2b7fc477b0423cbcc7be8ad8652e3552198de418 (diff) |
tcp: move TCP_ECN_create_request out of header
After Octavian Purdilas tcp ipv4/ipv6 unification work this helper only
has a single callsite.
While at it, convert name to lowercase, suggested by Stephen.
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/tcp.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 1f57c5363492..545a79aa4212 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -861,40 +861,6 @@ static inline void tcp_ca_event(struct sock *sk, const enum tcp_ca_event event) | |||
861 | icsk->icsk_ca_ops->cwnd_event(sk, event); | 861 | icsk->icsk_ca_ops->cwnd_event(sk, event); |
862 | } | 862 | } |
863 | 863 | ||
864 | /* RFC3168 : 6.1.1 SYN packets must not have ECT/ECN bits set | ||
865 | * | ||
866 | * If we receive a SYN packet with these bits set, it means a | ||
867 | * network is playing bad games with TOS bits. In order to | ||
868 | * avoid possible false congestion notifications, we disable | ||
869 | * TCP ECN negociation. | ||
870 | * | ||
871 | * Exception: tcp_ca wants ECN. This is required for DCTCP | ||
872 | * congestion control; it requires setting ECT on all packets, | ||
873 | * including SYN. We inverse the test in this case: If our | ||
874 | * local socket wants ECN, but peer only set ece/cwr (but not | ||
875 | * ECT in IP header) its probably a non-DCTCP aware sender. | ||
876 | */ | ||
877 | static inline void | ||
878 | TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb, | ||
879 | const struct sock *listen_sk) | ||
880 | { | ||
881 | const struct tcphdr *th = tcp_hdr(skb); | ||
882 | const struct net *net = sock_net(listen_sk); | ||
883 | bool th_ecn = th->ece && th->cwr; | ||
884 | bool ect, need_ecn; | ||
885 | |||
886 | if (!th_ecn) | ||
887 | return; | ||
888 | |||
889 | ect = !INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield); | ||
890 | need_ecn = tcp_ca_needs_ecn(listen_sk); | ||
891 | |||
892 | if (!ect && !need_ecn && net->ipv4.sysctl_tcp_ecn) | ||
893 | inet_rsk(req)->ecn_ok = 1; | ||
894 | else if (ect && need_ecn) | ||
895 | inet_rsk(req)->ecn_ok = 1; | ||
896 | } | ||
897 | |||
898 | /* These functions determine how the current flow behaves in respect of SACK | 864 | /* These functions determine how the current flow behaves in respect of SACK |
899 | * handling. SACK is negotiated with the peer, and therefore it can vary | 865 | * handling. SACK is negotiated with the peer, and therefore it can vary |
900 | * between different flows. | 866 | * between different flows. |