Skip to content

Commit

Permalink
[BRIDGE-NF]: Fix iptables redirect on bridge interface
Browse files Browse the repository at this point in the history
Here's a slightly altered patch, originally from Mark Glines who
diagnosed and fixed the problem.

Signed-off-by: Bart De Schuymer <bdschuym@pandora.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Bart De Schuymer authored and David S. Miller committed Sep 15, 2005
1 parent de9daad commit 1c011be
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,11 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
.tos = RT_TOS(iph->tos)} }, .proto = 0};

if (!ip_route_output_key(&rt, &fl)) {
/* Bridged-and-DNAT'ed traffic doesn't
* require ip_forwarding. */
if (((struct dst_entry *)rt)->dev == dev) {
/* - Bridged-and-DNAT'ed traffic doesn't
* require ip_forwarding.
* - Deal with redirected traffic. */
if (((struct dst_entry *)rt)->dev == dev ||
rt->rt_type == RTN_LOCAL) {
skb->dst = (struct dst_entry *)rt;
goto bridged_dnat;
}
Expand Down

0 comments on commit 1c011be

Please sign in to comment.