summaryrefslogtreecommitdiff
path: root/include/net/inet_ecn.h
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2011-05-19 05:36:21 (GMT)
committerKumar Gala <galak@kernel.crashing.org>2011-05-19 05:36:21 (GMT)
commit134c428e5a31f2d5ed3a70ba20dac83895ec8b82 (patch)
tree0fb28accbf09171b8a1ca792361f4160434529e8 /include/net/inet_ecn.h
parenta0496d450ab8c17f6c4d86979b1f6ba486fe9365 (diff)
parentc560bbceaf6b06e52f1ef20131b76a3fdc0a2c19 (diff)
downloadlinux-fsl-qoriq-134c428e5a31f2d5ed3a70ba20dac83895ec8b82.tar.xz
Merge remote branch 'benh/merge' into benh-next
Diffstat (limited to 'include/net/inet_ecn.h')
-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 88bdd01..2fa8d13 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)
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); \