summaryrefslogtreecommitdiffstats
path: root/br-nf-bds
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2002-10-19 14:27:20 +0000
committerBart De Schuymer <bdschuym@pandora.be>2002-10-19 14:27:20 +0000
commit4b627160debcbdee2465f5648e27625c5eb26065 (patch)
tree5f86062fa1d8904cf195970ebfa3e853de13d967 /br-nf-bds
parente68bed817a8999e48cc6062e11f0de95b4547a1c (diff)
add nf_bridge stuff
Diffstat (limited to 'br-nf-bds')
-rw-r--r--br-nf-bds/linux2.5/net/bridge/br_forward.c16
-rw-r--r--br-nf-bds/linux2.5/net/bridge/br_input.c12
2 files changed, 23 insertions, 5 deletions
diff --git a/br-nf-bds/linux2.5/net/bridge/br_forward.c b/br-nf-bds/linux2.5/net/bridge/br_forward.c
index 9f1bcb7..2d4fdf9 100644
--- a/br-nf-bds/linux2.5/net/bridge/br_forward.c
+++ b/br-nf-bds/linux2.5/net/bridge/br_forward.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_forward.c,v 1.4 2002/09/18 21:35:05 bdschuym Exp $
+ * $Id: br_forward.c,v 1.5 2002/10/19 14:27:20 bdschuym Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -33,6 +33,12 @@ static inline int should_deliver(struct net_bridge_port *p, struct sk_buff *skb)
int br_dev_queue_push_xmit(struct sk_buff *skb)
{
skb_push(skb, ETH_HLEN);
+
+#ifdef CONFIG_NETFILTER
+ if (skb->nf_bridge->mask & BRNF_COPY_HEADER)
+ memcpy(skb->data - 16, skb->nf_bridge->hh, 16);
+#endif
+
dev_queue_xmit(skb);
return 0;
@@ -52,7 +58,13 @@ static void __br_deliver(struct net_bridge_port *to, struct sk_buff *skb)
#ifdef CONFIG_NETFILTER_DEBUG
skb->nf_debug = 0;
#endif
- NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
+#ifdef CONFIG_NETFILTER
+ /* Used by br_netfilter.c */
+ if (!skb->nf_bridge && nf_bridge_alloc(skb) == NULL)
+ kfree_skb(skb);
+ else
+#endif
+ NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
br_forward_finish);
}
diff --git a/br-nf-bds/linux2.5/net/bridge/br_input.c b/br-nf-bds/linux2.5/net/bridge/br_input.c
index 7ad9a24..6a83e5e 100644
--- a/br-nf-bds/linux2.5/net/bridge/br_input.c
+++ b/br-nf-bds/linux2.5/net/bridge/br_input.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_input.c,v 1.4 2002/09/29 19:01:05 bdschuym Exp $
+ * $Id: br_input.c,v 1.5 2002/10/19 14:27:48 bdschuym Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -154,8 +154,14 @@ int br_handle_frame(struct sk_buff *skb)
return -1;
}
- NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
- br_handle_frame_finish);
+#ifdef CONFIG_NETFILTER
+ /* Used by br_netfilter.c */
+ if (nf_bridge_alloc(skb) == NULL)
+ kfree_skb(skb);
+ else
+#endif
+ NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev,
+ NULL, br_handle_frame_finish);
read_unlock(&br->lock);
return 0;
}