[PATCH] ebtables: fix limit and mark modules incompatibilities between 32-bit user space and 64-bit kernel space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Alin Nastac <alin.nastac@xxxxxxxxx>
---
 include/linux/netfilter_bridge/ebt_limit.h  | 4 ++++
 include/linux/netfilter_bridge/ebt_mark_m.h | 5 +++++
 include/linux/netfilter_bridge/ebt_mark_t.h | 4 ++++
 3 files changed, 13 insertions(+)

diff --git a/include/linux/netfilter_bridge/ebt_limit.h b/include/linux/netfilter_bridge/ebt_limit.h
index 66d80b3..6db2443 100644
--- a/include/linux/netfilter_bridge/ebt_limit.h
+++ b/include/linux/netfilter_bridge/ebt_limit.h
@@ -16,7 +16,11 @@ struct ebt_limit_info {
 	__u32 burst;  /* Period multiplier for upper limit. */
 
 	/* Used internally by the kernel */
+#ifdef KERNEL_64_USERSPACE_32
+	uint64_t prev;
+#else
 	unsigned long prev;
+#endif
 	__u32 credit;
 	__u32 credit_cap, cost;
 };
diff --git a/include/linux/netfilter_bridge/ebt_mark_m.h b/include/linux/netfilter_bridge/ebt_mark_m.h
index 410f9e5..017307f 100644
--- a/include/linux/netfilter_bridge/ebt_mark_m.h
+++ b/include/linux/netfilter_bridge/ebt_mark_m.h
@@ -7,7 +7,12 @@
 #define EBT_MARK_OR 0x02
 #define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
 struct ebt_mark_m_info {
+#ifdef KERNEL_64_USERSPACE_32
+	union { uint64_t pad1; unsigned long mark; };
+	union { uint64_t pad2; unsigned long mask; };
+#else
 	unsigned long mark, mask;
+#endif
 	__u8 invert;
 	__u8 bitmask;
 };
diff --git a/include/linux/netfilter_bridge/ebt_mark_t.h b/include/linux/netfilter_bridge/ebt_mark_t.h
index 7d5a268..5f0f6d5 100644
--- a/include/linux/netfilter_bridge/ebt_mark_t.h
+++ b/include/linux/netfilter_bridge/ebt_mark_t.h
@@ -14,7 +14,11 @@
 #define MARK_XOR_VALUE (0xffffffc0)
 
 struct ebt_mark_t_info {
+#ifdef KERNEL_64_USERSPACE_32
+	union { uint64_t pad; unsigned long mark; };
+#else
 	unsigned long mark;
+#endif
 	/* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
 	int target;
 };
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux