Skip to contentSkip to conversation

ipt_physdev extension

PATCH Applied Harald Welte 2 participants 2 messages Apr 27, 2003 – Apr 28, 2003

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipt_physdev extension

Hi Davem!

On behalf of Bart de Schuymer, I'm forwarding you this patch which adds some additional functionality to the 2.5.x ipt_physdev match.

Please apply, thanks.

net/bridge/br_netfilter.c renamed from net/bridge/br_netfilter.c.old +2 -0
@@ -348,6 +348,8 @@
 	if (skb->pkt_type == PACKET_OTHERHOST) {
 		skb->pkt_type = PACKET_HOST;
 		nf_bridge->mask |= BRNF_PKT_TYPE;
+		/* The physdev module checks on this */
+		nf_bridge->mask |= BRNF_BRIDGED;
 	}
 
 	nf_bridge->physoutdev = skb->dev;
include/linux/netfilter_bridge.h renamed from include/linux/netfilter_bridge.h.old +1 -0
@@ -30,6 +30,7 @@
 #define BRNF_PKT_TYPE			0x01
 #define BRNF_BRIDGED_DNAT		0x02
 #define BRNF_DONT_TAKE_PARENT		0x04
+#define BRNF_BRIDGED			0x08
 
 enum nf_br_hook_priorities {
 	NF_BR_PRI_FIRST = INT_MIN,
net/ipv4/netfilter/ipt_physdev.c renamed from net/ipv4/netfilter/ipt_physdev.c.old +49 -9

93 lines not on this page · raw message

include/linux/netfilter_ipv4/ipt_physdev.h renamed from include/linux/netfilter_ipv4/ipt_physdev.h.old +7 -2
@@ -5,11 +5,16 @@
 #include <linux/if.h>
 #endif
 
-#define IPT_PHYSDEV_OP_MATCH_IN 0x01
-#define IPT_PHYSDEV_OP_MATCH_OUT 0x02
+#define IPT_PHYSDEV_OP_IN		0x01
+#define IPT_PHYSDEV_OP_OUT		0x02
+#define IPT_PHYSDEV_OP_BRIDGED		0x04
+#define IPT_PHYSDEV_OP_ISIN		0x08
+#define IPT_PHYSDEV_OP_ISOUT		0x10
+#define IPT_PHYSDEV_OP_MASK		(0x20 - 1)
 
 struct ipt_physdev_info {
 	u_int8_t invert;
+	u_int8_t bitmask;
 	char physindev[IFNAMSIZ];
 	char in_mask[IFNAMSIZ];
 	char physoutdev[IFNAMSIZ];
Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie
#1 lore raw

From: Harald Welte <[email protected]>
Date: Sun, 27 Apr 2003 10:22:01 +0200

On behalf of Bart de Schuymer, I'm forwarding you this patch which adds some additional functionality to the 2.5.x ipt_physdev match.

Please apply, thanks.

Applied, thanks.