summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-06-02 15:48:49 +0000
committerkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-06-02 15:48:49 +0000
commit1fa85da6ec549b04713aa94415a46a55fbeb3968 (patch)
tree2d69ec3fa630a8f0f145f0e355ce582d23457cec
parent76047329b377d4177c703cc31bd7844848ea5415 (diff)
revert an upstream change to retain compatibility with iptables 1.4.0
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11326 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/generic-2.6/patches-2.6.26/950-revert_xt_sctp_simplify.patch103
1 files changed, 103 insertions, 0 deletions
diff --git a/target/linux/generic-2.6/patches-2.6.26/950-revert_xt_sctp_simplify.patch b/target/linux/generic-2.6/patches-2.6.26/950-revert_xt_sctp_simplify.patch
new file mode 100644
index 0000000000..6c8cdf1576
--- /dev/null
+++ b/target/linux/generic-2.6/patches-2.6.26/950-revert_xt_sctp_simplify.patch
@@ -0,0 +1,103 @@
+--- linux-2.6.26-rc4/include/linux/netfilter/xt_sctp.h 2008-05-26 20:08:11.000000000 +0200
++++ linux-2.6.26-rc4-owrt/include/linux/netfilter/xt_sctp.h 2008-06-02 13:30:15.000000000 +0200
+@@ -37,54 +37,68 @@
+
+ #define SCTP_CHUNKMAP_SET(chunkmap, type) \
+ do { \
+- (chunkmap)[type / bytes(u_int32_t)] |= \
++ chunkmap[type / bytes(u_int32_t)] |= \
+ 1 << (type % bytes(u_int32_t)); \
+ } while (0)
+
+ #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
+ do { \
+- (chunkmap)[type / bytes(u_int32_t)] &= \
++ chunkmap[type / bytes(u_int32_t)] &= \
+ ~(1 << (type % bytes(u_int32_t))); \
+ } while (0)
+
+ #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
+ ({ \
+- ((chunkmap)[type / bytes (u_int32_t)] & \
++ (chunkmap[type / bytes (u_int32_t)] & \
+ (1 << (type % bytes (u_int32_t)))) ? 1: 0; \
+ })
+
+-#define SCTP_CHUNKMAP_RESET(chunkmap) \
+- memset((chunkmap), 0, sizeof(chunkmap))
++#define SCTP_CHUNKMAP_RESET(chunkmap) \
++ do { \
++ int i; \
++ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
++ chunkmap[i] = 0; \
++ } while (0)
+
+-#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
+- memset((chunkmap), ~0U, sizeof(chunkmap))
++#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
++ do { \
++ int i; \
++ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
++ chunkmap[i] = ~0; \
++ } while (0)
+
+-#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
+- memcpy((destmap), (srcmap), sizeof(srcmap))
++#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
++ do { \
++ int i; \
++ for (i = 0; i < ARRAY_SIZE(srcmap); i++) \
++ destmap[i] = srcmap[i]; \
++ } while (0)
++
++#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
++({ \
++ int i; \
++ int flag = 1; \
++ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
++ if (chunkmap[i]) { \
++ flag = 0; \
++ break; \
++ } \
++ } \
++ flag; \
++})
+
+-#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
+- __sctp_chunkmap_is_clear((chunkmap), ARRAY_SIZE(chunkmap))
+-static inline bool
+-__sctp_chunkmap_is_clear(const u_int32_t *chunkmap, unsigned int n)
+-{
+- unsigned int i;
+- for (i = 0; i < n; ++i)
+- if (chunkmap[i])
+- return false;
+- return true;
+-}
+-
+-#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
+- __sctp_chunkmap_is_all_set((chunkmap), ARRAY_SIZE(chunkmap))
+-static inline bool
+-__sctp_chunkmap_is_all_set(const u_int32_t *chunkmap, unsigned int n)
+-{
+- unsigned int i;
+- for (i = 0; i < n; ++i)
+- if (chunkmap[i] != ~0U)
+- return false;
+- return true;
+-}
++#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
++({ \
++ int i; \
++ int flag = 1; \
++ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
++ if (chunkmap[i] != ~0) { \
++ flag = 0; \
++ break; \
++ } \
++ } \
++ flag; \
++})
+
+ #endif /* _XT_SCTP_H_ */
+