aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteinar H. Gunderson <sgunderson@bigfoot.com>2011-05-06 19:44:46 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-12 18:52:14 -0400
commitca06707022d6ba4744198a8ebbe4994786b0c613 (patch)
tree829c4c904b4e3c21c9ae5dd05e5262cc430502c9 /include
parent2592a7354092afd304a8c067319b15ab1e441e35 (diff)
ipv6: restore correct ECN handling on TCP xmit
Since commit e9df2e8fd8fbc9 (Use appropriate sock tclass setting for routing lookup) we lost ability to properly add ECN codemarks to ipv6 TCP frames. It seems like TCP_ECN_send() calls INET_ECN_xmit(), which only sets the ECN bit in the IPv4 ToS field (inet_sk(sk)->tos), but after the patch, what's checked is inet6_sk(sk)->tclass, which is a completely different field. Close bug https://bugzilla.kernel.org/show_bug.cgi?id=34322 [Eric Dumazet] : added the INET_ECN_dontxmit() fix and replace macros by inline functions for clarity. Signed-off-by: Steinar H. Gunderson <sgunderson@bigfoot.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/inet_ecn.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 88bdd010d65d..2fa8d1341a0a 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -38,9 +38,19 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
38 return outer; 38 return outer;
39} 39}
40 40
41#define INET_ECN_xmit(sk) do { inet_sk(sk)->tos |= INET_ECN_ECT_0; } while (0) 41static inline void INET_ECN_xmit(struct sock *sk)
42#define INET_ECN_dontxmit(sk) \ 42{
43 do { inet_sk(sk)->tos &= ~INET_ECN_MASK; } while (0) 43 inet_sk(sk)->tos |= INET_ECN_ECT_0;
44 if (inet6_sk(sk) != NULL)
45 inet6_sk(sk)->tclass |= INET_ECN_ECT_0;
46}
47
48static inline void INET_ECN_dontxmit(struct sock *sk)
49{
50 inet_sk(sk)->tos &= ~INET_ECN_MASK;
51 if (inet6_sk(sk) != NULL)
52 inet6_sk(sk)->tclass &= ~INET_ECN_MASK;
53}
44 54
45#define IP6_ECN_flow_init(label) do { \ 55#define IP6_ECN_flow_init(label) do { \
46 (label) &= ~htonl(INET_ECN_MASK << 20); \ 56 (label) &= ~htonl(INET_ECN_MASK << 20); \