From: Travis Kemen Date: Sun, 8 May 2011 17:08:06 +0000 (+0000) Subject: [PATCH] ipv6: restore correct ECN handling on TCP xmit X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=b59c4b9201c40059c617e6658c02b450c87c5615;hp=01bcbd62ca78fc946d3fc0982d3e601628ac0144 [PATCH] ipv6: restore correct ECN handling on TCP xmit Thanks Dave Taht SVN-Revision: 26858 --- diff --git a/target/linux/generic/patches-2.6.37/110_fix_ecn_marking_ipv6.patch b/target/linux/generic/patches-2.6.37/110_fix_ecn_marking_ipv6.patch new file mode 100644 index 0000000000..442e5e3c32 --- /dev/null +++ b/target/linux/generic/patches-2.6.37/110_fix_ecn_marking_ipv6.patch @@ -0,0 +1,25 @@ +--- 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) + return outer; + } + +-#define INET_ECN_xmit(sk) do { inet_sk(sk)->tos |= INET_ECN_ECT_0; } while (0) +-#define INET_ECN_dontxmit(sk) \ +- do { inet_sk(sk)->tos &= ~INET_ECN_MASK; } while (0) ++static inline void INET_ECN_xmit(struct sock *sk) ++{ ++ inet_sk(sk)->tos |= INET_ECN_ECT_0; ++ if (inet6_sk(sk) != NULL) ++ inet6_sk(sk)->tclass |= INET_ECN_ECT_0; ++} ++ ++static inline void INET_ECN_dontxmit(struct sock *sk) ++{ ++ inet_sk(sk)->tos &= ~INET_ECN_MASK; ++ if (inet6_sk(sk) != NULL) ++ inet6_sk(sk)->tclass &= ~INET_ECN_MASK; ++} + + #define IP6_ECN_flow_init(label) do { \ + (label) &= ~htonl(INET_ECN_MASK << 20); \ diff --git a/target/linux/generic/patches-2.6.38/110_fix_ecn_marking_ipv6.patch b/target/linux/generic/patches-2.6.38/110_fix_ecn_marking_ipv6.patch new file mode 100644 index 0000000000..442e5e3c32 --- /dev/null +++ b/target/linux/generic/patches-2.6.38/110_fix_ecn_marking_ipv6.patch @@ -0,0 +1,25 @@ +--- 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) + return outer; + } + +-#define INET_ECN_xmit(sk) do { inet_sk(sk)->tos |= INET_ECN_ECT_0; } while (0) +-#define INET_ECN_dontxmit(sk) \ +- do { inet_sk(sk)->tos &= ~INET_ECN_MASK; } while (0) ++static inline void INET_ECN_xmit(struct sock *sk) ++{ ++ inet_sk(sk)->tos |= INET_ECN_ECT_0; ++ if (inet6_sk(sk) != NULL) ++ inet6_sk(sk)->tclass |= INET_ECN_ECT_0; ++} ++ ++static inline void INET_ECN_dontxmit(struct sock *sk) ++{ ++ inet_sk(sk)->tos &= ~INET_ECN_MASK; ++ if (inet6_sk(sk) != NULL) ++ inet6_sk(sk)->tclass &= ~INET_ECN_MASK; ++} + + #define IP6_ECN_flow_init(label) do { \ + (label) &= ~htonl(INET_ECN_MASK << 20); \