From a2ffc9c1555123cd2cbfc1edf7899bc581b0f967 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Tue, 9 Jul 2002 13:38:50 +0000 Subject: MAC destination address for redirect in BROUTE should be the address of the physical device. MAC destination address for redirect in PREROUTING should be the address of the logical bridge device. --- kernel/linux/net/bridge/netfilter/ebt_redirect.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'kernel/linux/net/bridge') diff --git a/kernel/linux/net/bridge/netfilter/ebt_redirect.c b/kernel/linux/net/bridge/netfilter/ebt_redirect.c index 6580fe3..1b8d696 100644 --- a/kernel/linux/net/bridge/netfilter/ebt_redirect.c +++ b/kernel/linux/net/bridge/netfilter/ebt_redirect.c @@ -22,9 +22,14 @@ static int ebt_target_redirect(struct sk_buff **pskb, unsigned int hooknr, { struct ebt_redirect_info *infostuff = (struct ebt_redirect_info *) data; - memcpy((**pskb).mac.ethernet->h_dest, - in->br_port->br->dev.dev_addr, ETH_ALEN); - (*pskb)->pkt_type = PACKET_HOST; + if (hooknr != NF_BR_BROUTING) + memcpy((**pskb).mac.ethernet->h_dest, + in->br_port->br->dev.dev_addr, ETH_ALEN); + else { + memcpy((**pskb).mac.ethernet->h_dest, + in->dev_addr, ETH_ALEN); + (*pskb)->pkt_type = PACKET_HOST; + } return infostuff->target; } -- cgit v1.2.3