All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] fix CLUSTERIP rule deletion in iptables
@ 2005-03-06 22:41 Pablo Neira
  0 siblings, 0 replies; only message in thread
From: Pablo Neira @ 2005-03-06 22:41 UTC (permalink / raw)
  To: Netfilter Development Mailinglist; +Cc: Harald Welte

[-- Attachment #1: Type: text/plain, Size: 61 bytes --]

This fixes rule deletion in CLUSTERIP in iptables.

--
Pablo

[-- Attachment #2: fix-cluster-del.patch --]
[-- Type: text/x-patch, Size: 1993 bytes --]

Index: include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
===================================================================
--- include/linux/netfilter_ipv4/ipt_CLUSTERIP.h	(revision 0)
+++ include/linux/netfilter_ipv4/ipt_CLUSTERIP.h	(revision 0)
@@ -0,0 +1,37 @@
+#ifndef _IPT_CLUSTERIP_H_target
+#define _IPT_CLUSTERIP_H_target
+
+enum clusterip_hashmode {
+    CLUSTERIP_HASHMODE_SIP = 0,
+    CLUSTERIP_HASHMODE_SIP_SPT,
+    CLUSTERIP_HASHMODE_SIP_SPT_DPT,
+};
+
+#define CLUSTERIP_HASHMODE_MAX CLUSTERIP_HASHMODE_SIP_SPT_DPT
+
+#define CLUSTERIP_MAX_NODES 16
+
+#define CLUSTERIP_FLAG_NEW 0x00000001
+
+struct clusterip_config;
+
+struct ipt_clusterip_tgt_info {
+
+	u_int32_t flags;
+	
+	/* only relevant for new ones */
+	u_int8_t clustermac[6];
+	u_int16_t num_total_nodes;
+	u_int16_t num_local_nodes;
+	u_int16_t local_nodes[CLUSTERIP_MAX_NODES];
+	enum clusterip_hashmode hash_mode;
+	u_int32_t hash_initval;
+	
+#ifdef KERNEL_64_USERSPACE_32
+	u_int64_t config;
+#else
+	struct clusterip_config *config;
+#endif
+};
+
+#endif /*_IPT_CLUSTERIP_H_target*/
Index: extensions/libipt_CLUSTERIP.c
===================================================================
--- extensions/libipt_CLUSTERIP.c	(revision 3742)
+++ extensions/libipt_CLUSTERIP.c	(working copy)
@@ -7,6 +7,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <getopt.h>
+#include <stddef.h>
 
 #if defined(__GLIBC__) && __GLIBC__ == 2
 #include <net/ethernet.h>
@@ -16,7 +17,7 @@
 
 #include <iptables.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
-#include <linux/netfilter_ipv4/ipt_CLUSTERIP.h>
+#include "../include/linux/netfilter_ipv4/ipt_CLUSTERIP.h"
 
 static void
 help(void)
@@ -242,7 +243,7 @@
 	.name		= "CLUSTERIP",
 	.version	= IPTABLES_VERSION,
 	.size		= IPT_ALIGN(sizeof(struct ipt_clusterip_tgt_info)),
-	.userspacesize	= IPT_ALIGN(sizeof(struct ipt_clusterip_tgt_info)),
+	.userspacesize	= offsetof(struct ipt_clusterip_tgt_info, config),
  	.help		= &help,
 	.init		= &init,
 	.parse		= &parse,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-06 22:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-06 22:41 [PATCH 2/2] fix CLUSTERIP rule deletion in iptables Pablo Neira

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.