From 4b627160debcbdee2465f5648e27625c5eb26065 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Sat, 19 Oct 2002 14:27:20 +0000 Subject: add nf_bridge stuff --- br-nf-bds/linux2.5/net/bridge/br_forward.c | 16 ++++++++++++++-- br-nf-bds/linux2.5/net/bridge/br_input.c | 12 +++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) (limited to 'br-nf-bds') 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 * - * $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 * - * $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; } -- cgit v1.2.3