diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2013-01-05 11:10:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-07 00:09:56 -0500 |
commit | 5d134f1c1f36166e8a738de92c4d2f4c262ff91b (patch) | |
tree | 6d1504359c7f1ade1c79da0e468a2a409af5c56c /include | |
parent | 71bcdba06db91ceaaffe019b6c958b5faf06012a (diff) |
tcp: make sysctl_tcp_ecn namespace aware
As per suggestion from Eric Dumazet this patch makes tcp_ecn sysctl
namespace aware. The reason behind this patch is to ease the testing
of ecn problems on the internet and allows applications to tune their
own use of ecn.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/netns/ipv4.h | 2 | ||||
-rw-r--r-- | include/net/tcp.h | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 2ae2b8372cfd..9b78862014a4 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -61,6 +61,8 @@ struct netns_ipv4 { | |||
61 | int sysctl_icmp_ratemask; | 61 | int sysctl_icmp_ratemask; |
62 | int sysctl_icmp_errors_use_inbound_ifaddr; | 62 | int sysctl_icmp_errors_use_inbound_ifaddr; |
63 | 63 | ||
64 | int sysctl_tcp_ecn; | ||
65 | |||
64 | kgid_t sysctl_ping_group_range[2]; | 66 | kgid_t sysctl_ping_group_range[2]; |
65 | long sysctl_tcp_mem[3]; | 67 | long sysctl_tcp_mem[3]; |
66 | 68 | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index aed42c785153..614af8b7758e 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -266,7 +266,6 @@ extern int sysctl_tcp_abort_on_overflow; | |||
266 | extern int sysctl_tcp_max_orphans; | 266 | extern int sysctl_tcp_max_orphans; |
267 | extern int sysctl_tcp_fack; | 267 | extern int sysctl_tcp_fack; |
268 | extern int sysctl_tcp_reordering; | 268 | extern int sysctl_tcp_reordering; |
269 | extern int sysctl_tcp_ecn; | ||
270 | extern int sysctl_tcp_dsack; | 269 | extern int sysctl_tcp_dsack; |
271 | extern int sysctl_tcp_wmem[3]; | 270 | extern int sysctl_tcp_wmem[3]; |
272 | extern int sysctl_tcp_rmem[3]; | 271 | extern int sysctl_tcp_rmem[3]; |
@@ -504,7 +503,8 @@ static inline __u32 cookie_v4_init_sequence(struct sock *sk, | |||
504 | #endif | 503 | #endif |
505 | 504 | ||
506 | extern __u32 cookie_init_timestamp(struct request_sock *req); | 505 | extern __u32 cookie_init_timestamp(struct request_sock *req); |
507 | extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); | 506 | extern bool cookie_check_timestamp(struct tcp_options_received *opt, |
507 | struct net *net, bool *ecn_ok); | ||
508 | 508 | ||
509 | /* From net/ipv6/syncookies.c */ | 509 | /* From net/ipv6/syncookies.c */ |
510 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); | 510 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); |
@@ -728,11 +728,12 @@ struct tcp_skb_cb { | |||
728 | * notifications, we disable TCP ECN negociation. | 728 | * notifications, we disable TCP ECN negociation. |
729 | */ | 729 | */ |
730 | static inline void | 730 | static inline void |
731 | TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb) | 731 | TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb, |
732 | struct net *net) | ||
732 | { | 733 | { |
733 | const struct tcphdr *th = tcp_hdr(skb); | 734 | const struct tcphdr *th = tcp_hdr(skb); |
734 | 735 | ||
735 | if (sysctl_tcp_ecn && th->ece && th->cwr && | 736 | if (net->ipv4.sysctl_tcp_ecn && th->ece && th->cwr && |
736 | INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield)) | 737 | INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield)) |
737 | inet_rsk(req)->ecn_ok = 1; | 738 | inet_rsk(req)->ecn_ok = 1; |
738 | } | 739 | } |