summaryrefslogtreecommitdiff
path: root/datapath
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2011-03-03 13:38:09 -0800
committerJesse Gross <jesse@nicira.com>2011-03-03 14:57:18 -0800
commitf45ee2cd9a8cd2a4f2a60fd36da9f95775e2efa6 (patch)
tree430f9300de81a6a36ba4eedea061db577b10fbd2 /datapath
parentfdd89fdc9943878e7cb1c43ba872b13f26c25e59 (diff)
downloadopenvswitch-f45ee2cd9a8cd2a4f2a60fd36da9f95775e2efa6.tar.gz
datapath: Add backport for USHRT_MAX.
Kernels before 2.6.26 didn't have type limits for short at all and before 2.6.35 it was called SHORT instead of SHRT. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath')
-rw-r--r--datapath/linux-2.6/compat-2.6/include/linux/kernel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/datapath/linux-2.6/compat-2.6/include/linux/kernel.h b/datapath/linux-2.6/compat-2.6/include/linux/kernel.h
index 1c9f40147..2c2220b9f 100644
--- a/datapath/linux-2.6/compat-2.6/include/linux/kernel.h
+++ b/datapath/linux-2.6/compat-2.6/include/linux/kernel.h
@@ -48,4 +48,10 @@
#error "CONFIG_PREEMPT is broken before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\""
#endif
+#ifndef USHRT_MAX
+#define USHRT_MAX ((u16)(~0U))
+#define SHRT_MAX ((s16)(USHRT_MAX>>1))
+#define SHRT_MIN ((s16)(-SHRT_MAX - 1))
+#endif
+
#endif /* linux/kernel.h */