Skip to contentSkip to conversation

arptables: mcmangle target support

PATCH New Pablo Neira Ayuso 1 participant 1 message Jan 28, 2009 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 arptables: mcmangle target support

extensions/Makefile +1 -1
Index: arptables-v0.0.3-3/extensions/Makefile
===================================================================
@@ -1,6 +1,6 @@
 #! /usr/bin/make
 
-EXT_FUNC+=standard mangle
+EXT_FUNC+=standard mangle mcmangle
 EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o)
 
 extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
extensions/arpt_mcmangle.c new file +122 -0

122 lines not on this page · raw message

include/linux/netfilter_arp/arpt_mcmangle.h new file +14 -0
Index: arptables-v0.0.3-3/include/linux/netfilter_arp/arpt_mcmangle.h
===================================================================
@@ -0,0 +1,14 @@
+#ifndef _ARPT_MCMANGLE_H
+#define _ARPT_MCMANGLE_H
+#include <linux/netfilter_arp/arp_tables.h>
+
+struct net_device;
+
+struct arpt_mcmangle
+{
+	char ifname[IFNAMSIZ];
+	char mc_devaddr[ETH_ALEN];
+	struct net_device __attribute__((aligned(8))) *dev;
+};
+
+#endif /* _ARPT_MANGLE_H */
include/arptables_common.h +3 -0
Index: arptables-v0.0.3-3/include/arptables_common.h
===================================================================
@@ -1,6 +1,9 @@
 #ifndef _ARPTABLES_COMMON_H
 #define _ARPTABLES_COMMON_H
 
+#undef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+
 enum exittype {
 	OTHER_PROBLEM = 1,
 	PARAMETER_PROBLEM,