Skip to contentSkip to conversation

ip_queue and bridge-nf

PATCH New Bart De Schuymer 1 participant 1 message Jul 17, 2003

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

PATCH 1/1 ip_queue and bridge-nf

Hi Harald,

The attached patch solves the bridge-nf problem discussed in another mail on this list. Please send it to Dave at your convenience, it's vs 2.6.0-test1.

Here's the problem summary:
When copying skbuffs, iptables targets don't care about the Data Link header, since they assume that will be filled in later. When the packet is being bridged, however, the MAC header needs to be copied since it won't and can't be filled in later.
There are probably other iptables modules that will need a similar patch.

cheers,
Bart

net/ipv4/netfilter/ip_queue.c renamed from net/ipv4/netfilter/ip_queue.c.old +5 -0
@@ -353,6 +353,11 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, st
 			}
 			if (e->skb->sk)
 				skb_set_owner_w(newskb, e->skb->sk);
+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
+			/* bridged packets already have their Ethernet header */
+			if (e->skb->nf_bridge)
+				memcpy(newskb->data - 16, e->skb->data - 16, 16);
+#endif
 			kfree_skb(e->skb);
 			e->skb = newskb;
 		}